]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agoAMI/ARI: Update version to 2.5.0/1.5.0 respectively
Matthew Jordan [Mon, 11 Aug 2014 18:48:18 +0000 (18:48 +0000)] 
AMI/ARI: Update version to 2.5.0/1.5.0 respectively

This is to support the backwards compatible changes made in the next version
of Asterisk.

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

10 years agoStasis: Use the correct return value
Kinsey Moore [Mon, 11 Aug 2014 18:45:11 +0000 (18:45 +0000)] 
Stasis: Use the correct return value

Return the correct value instead of always returning 0 when setting
internal status on unreal channels.

Reported by: Richard Mudgett

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

10 years agoStasis: Allow internal channels directly into bridges
Kinsey Moore [Mon, 11 Aug 2014 18:35:27 +0000 (18:35 +0000)] 
Stasis: Allow internal channels directly into bridges

The patch to catch channels being shoehorned into Stasis() via external
mechanisms also happens to catch Announcer and Recorder channels
because they aren't known to be stasis-controlled channels in the usual
sense. This marks those channels as Stasis()-internal channels and
allows them directly into bridges.

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

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

10 years agogeneral: Fix memory Corruption in __ast_string_field_ptr_build_va.
Walter Doekes [Mon, 11 Aug 2014 10:37:41 +0000 (10:37 +0000)] 
general: Fix memory Corruption in __ast_string_field_ptr_build_va.

If the space left in a stringfield is between 0 and
(alignof(ast_string_field_allocation)-1) adding new data would cause
memory corruption, because we would assume enough space (unsigned
underrun).

Thanks Arnd Schmitter for reporting and finding out the cause!

ASTERISK-23508 #close
Reported by: Arnd Schmitter
Tested by: Arnd Schmitter, JoshE

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

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

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

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

10 years agotcptls: Avoid compiler warning on non-dev-mode.
Walter Doekes [Mon, 11 Aug 2014 09:53:29 +0000 (09:53 +0000)] 
tcptls: Avoid compiler warning on non-dev-mode.
........

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

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

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

10 years agomain/message: remove debug message
Matthew Jordan [Fri, 8 Aug 2014 12:31:25 +0000 (12:31 +0000)] 
main/message: remove debug message

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

11 years agoCEL: Update unit tests for additional information
Kinsey Moore [Fri, 8 Aug 2014 02:51:15 +0000 (02:51 +0000)] 
CEL: Update unit tests for additional information

This updates the CEL unit tests for the new information contained in
the attended transfer CEL extra field.

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

11 years agochan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.
Richard Mudgett [Thu, 7 Aug 2014 21:48:58 +0000 (21:48 +0000)] 
chan_sip: Replace sip_tls_read() and resolve the large SDP poll issue.

Replace sip_tls_read() and sip_tcp_read() with a single function and
resolve the poll/wait issue with large SDP payloads.

ASTERISK-18345 #close
Reported by: Stephane Chazelas
Patches:
      tcptls_pollv4.diff (license #5835) patch uploaded by Elazar Broad

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

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

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

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

11 years agoStasis: Correct blind transfer message generation
Kinsey Moore [Thu, 7 Aug 2014 21:16:11 +0000 (21:16 +0000)] 
Stasis: Correct blind transfer message generation

This fixes the json object creation format string and key name for the
BridgeBlindTransfer Stasis event allowing it to be published properly.

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

11 years agoStasis: Ensure transfer messages follow validation rules
Kinsey Moore [Thu, 7 Aug 2014 20:23:30 +0000 (20:23 +0000)] 
Stasis: Ensure transfer messages follow validation rules

This makes Stasis() event generation for transfer messages follow
validation rules. Currently, ast_json_null() is being used in place of
omitting a key entirely which falls afoul of these validation rules.

https://reviewboard.asterisk.org/r/3892/

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

11 years agoEnsure bridges exist when trying to determine bridged parties when publishing transfe...
Mark Michelson [Thu, 7 Aug 2014 19:43:59 +0000 (19:43 +0000)] 
Ensure bridges exist when trying to determine bridged parties when publishing transfer information.

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

11 years agoRevert previous patch since it had some unreviewed content in it.
Mark Michelson [Thu, 7 Aug 2014 19:42:43 +0000 (19:42 +0000)] 
Revert previous patch since it had some unreviewed content in it.

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

11 years agoEnsure bridges actually exist when trying to determine the bridged peer.
Mark Michelson [Thu, 7 Aug 2014 19:37:00 +0000 (19:37 +0000)] 
Ensure bridges actually exist when trying to determine the bridged peer.

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

11 years agoStasis: Convey transfer information to applications
Kinsey Moore [Thu, 7 Aug 2014 15:19:53 +0000 (15:19 +0000)] 
Stasis: Convey transfer information to applications

This fixes a class of issues where Stasis applications were not made
aware that their channels were being manipulated or replaced by
external entitiessuch as transfers, AMI commands, or dialplan
applications such as Bridge(). Inconsistent information such as
StasisEnd events with unknown channels as a result of masquerades has
also been corrected. To accomplish these fixes, several new fields
were added to blind and attended transfer messages as well as
StasisStart and BridgeAttendedTransfer Stasis events.

ASTERISK-23941 #close
Review: https://reviewboard.asterisk.org/r/3865/
Review: https://reviewboard.asterisk.org/r/3857/
Review: https://reviewboard.asterisk.org/r/3852/
Review: https://reviewboard.asterisk.org/r/3816/
Review: https://reviewboard.asterisk.org/r/3731/
Review: https://reviewboard.asterisk.org/r/3729/
Review: https://reviewboard.asterisk.org/r/3728/

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

11 years agoChange comment.
Richard Mudgett [Wed, 6 Aug 2014 21:47:30 +0000 (21:47 +0000)] 
Change comment.

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

11 years agoalembic: Adjust sippeers, queue_members, and voicemail_messages tables.
Richard Mudgett [Wed, 6 Aug 2014 16:51:49 +0000 (16:51 +0000)] 
alembic: Adjust sippeers, queue_members, and voicemail_messages tables.

* Increased the sippeers useragent max string size to 255.

* Changed the queue_members uniqueid to an auto incremented integer
instead of a string.

* Increased the voicemail_messages BLOB size to LONGBLOB on mysql.

* Fixed the add_tables_for_pjsip config change version downgrade actions
to drop a table it created.

* Adjusted the sample alembic.ini files cdr.ini.sample, config.ini.sample,
and voicemail.ini.sample to give a mysql and postgres sqlalchemy.url
lines.

ASTERISK-23847 #close
Reported by: Stephen More

ASTERISK-23825 #close
Reported by: Stephen More

ASTERISK-23909 #close
Reported by: Stephen More

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

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

11 years agopbx_lua: fix regression with global sym export and context clash by pbx_config.
George Joseph [Wed, 6 Aug 2014 16:10:01 +0000 (16:10 +0000)] 
pbx_lua: fix regression with global sym export and context clash by pbx_config.

ASTERISK-23818 (lua contexts being overwritten by contexts of the same name in
pbx_config) surfaced because pbx_lua, having the AST_MODFLAG_GLOBAL_SYMBOLS
set, was always force loaded before pbx_config.  Since I couldn't find any
reason for pbx_lua to export it's symbols to the rest of Asterisk, I simply
changed the flag to AST_MODFLAG_DEFAULT.  Problem solved.  What I didn't
realize was that the symbols need to be exported not because Asterisk needs
them but because any external Lua modules like luasql.mysql need the base
Lua language APIs exported (ASTERISK-17279).

Back to ASTERISK-23818...  It looks like there's an issue in pbx.c where
context_merge was only merging includes, switches and ignore patterns if
the context was already existing AND has extensions, or if the context was
brand new.  If pbx_lua is loaded before pbx_config, the context will exist
BUT pbx_lua, being implemented as a switch, will never place extensions in
it, just the switch statement.  The result is that when pbx_config loads,
it never merges the switch statement created by pbx_lua into the final
context.

This patch sets pbx_lua's modflag back to AST_MODFLAG_GLOBAL_SYMBOLS and adds
an "else if" in context_merge that catches the case where an existing context
has includes, switchs or ingore patterns but no actual extensions.

ASTERISK-23818 #close
Reported by: Dennis Guse
Reported by: Timo Teräs
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3891/
........

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

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

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

11 years agostasis: Fix compilation issue with ao2 tagged objects
Matthew Jordan [Tue, 5 Aug 2014 21:47:51 +0000 (21:47 +0000)] 
stasis: Fix compilation issue with ao2 tagged objects

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

11 years agotest_message: Fix strict-aliasing compilation issue
Matthew Jordan [Tue, 5 Aug 2014 21:36:25 +0000 (21:36 +0000)] 
test_message: Fix strict-aliasing compilation issue

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

11 years agoRemove automerge properties :-(
Matthew Jordan [Tue, 5 Aug 2014 20:16:37 +0000 (20:16 +0000)] 
Remove automerge properties :-(

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

11 years agoARI: Add channel technology agnostic out of call text messaging
Matthew Jordan [Tue, 5 Aug 2014 20:10:52 +0000 (20:10 +0000)] 
ARI: Add channel technology agnostic out of call text messaging

This patch adds the ability to send and receive text messages from various
technology stacks in Asterisk through ARI. This includes chan_sip (sip),
res_pjsip_messaging (pjsip), and res_xmpp (xmpp). Messages are sent using the
endpoints resource, and can be sent directly through that resource, or to a
particular endpoint.

For example, the following would send the message "Hello there" to PJSIP
endpoint alice with a display URI of sip:asterisk@mycooldomain.org:

ari/endpoints/sendMessage?to=pjsip:alice&from=sip:asterisk@mycooldomain.org&body=Hello+There

This is equivalent to the following as well:

ari/endpoints/PJSIP/alice/sendMessage?from=sip:asterisk@mycooldomain.org&body=Hello+There

Both forms are available for message technologies that allow for arbitrary
destinations, such as chan_sip.

Inbound messages can now be received over ARI as well. An ARI application that
subscribes to endpoints will receive messages from those endpoints:

{
  "type": "TextMessageReceived",
  "timestamp": "2014-07-12T22:53:13.494-0500",
  "endpoint": {
    "technology": "PJSIP",
    "resource": "alice",
    "state": "online",
    "channel_ids": []
  },
  "message": {
    "from": "\"alice\" <sip:alice@127.0.0.1>",
    "to": "pjsip:asterisk@127.0.0.1",
    "body": "Watson, come here.",
    "variables": []
  },
  "application": "testsuite"
}

The above was made possible due to some rather major changes in the message
core. This includes (but is not limited to):
- Users of the message API can now register message handlers. A handler has
  two callbacks: one to determine if the handler has a destination for the
  message, and another to handle it.
- All dialplan functionality of handling a message was moved into a message
  handler provided by the message API.
- Messages can now have the technology/endpoint associated with them.
  Various other properties are also now more easily accessible.
- A number of ao2 containers that weren't really needed were replaced with
  vectors. Iteration over ao2_containers is expensive and pointless when
  the lifetime of things is well defined and the number of things is very
  small.

res_stasis now has a new file that makes up its structure, messaging. The
messaging functionality implements a message handler, and passes received
messages that match an interested endpoint over to the app for processing.

Note that inadvertently while testing this, I reproduced ASTERISK-23969.
res_pjsip_messaging was incorrectly parsing out the 'to' field, such that
arbitrary SIP URIs mangled the endpoint lookup. This patch includes the
fix for that as well.

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

ASTERISK-23692 #close
Reported by: Matt Jordan

ASTERISK-23969 #close
Reported by: Andrew Nagy

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

11 years agoformat.c: Add reason comments for the format_list ordering.
Richard Mudgett [Tue, 5 Aug 2014 19:12:40 +0000 (19:12 +0000)] 
format.c: Add reason comments for the format_list ordering.
........

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

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

11 years agoManager - Improve documentation for manager commands Getvar and Setvar.
Rusty Newton [Mon, 4 Aug 2014 19:45:33 +0000 (19:45 +0000)] 
Manager - Improve documentation for manager commands Getvar and Setvar.

The documentation for these commands did not make it clear that they could
accept expressions and functions. Modified to make this clear, but tried
not to be overly explicit.

ASTERISK-21178 #close
Reported by: Rusty Newton
Tested by: Rusty Newton

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

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

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

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

11 years agoGet rid of automerge properties
Matthew Jordan [Thu, 31 Jul 2014 11:57:11 +0000 (11:57 +0000)] 
Get rid of automerge properties

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

11 years agores_hep_rtcp: Add module that sends RTCP information to a Homer Server
Matthew Jordan [Thu, 31 Jul 2014 11:55:19 +0000 (11:55 +0000)] 
res_hep_rtcp: Add module that sends RTCP information to a Homer Server

This patch adds a new module to Asterisk, res_hep_rtcp. The module subscribes
to the RTCP topics in Stasis and receives RTCP information back from the
message bus. It encodes into HEPv3 packets and sends the information to the
res_hep module for transmission.

Using this, someone with a Homer server can get live call quality monitoring
for all RTP-based channels in their Asterisk 12+ systems.

In addition, there were a few bugs in the RTP engine, res_rtp_asterisk, and
chan_pjsip that were uncovered by the tests written for the Asterisk Test
Suite. This patch fixes the following:
1) chan_pjsip failed to set its channel unique ids on its RTP instance on
   outbound calls. It now does this in the appropriate location, in the
   serialized call callback.
2) The rtp_engine was overflowing some values when packed into JSON.
   Specifically, some longs and unsigned ints can't be be packed into integer
   values, for obvious reasons. Since libjansson only supports integers,
   floats, strings, booleans, and objects, we print these values into strings.
3) res_rtp_asterisk had a few problems:
   (a) it would emit a source IP address of 0.0.0.0 if bound to that IP
       address. We now use ast_find_ourip to get a better IP address, and
       properly marshal the result into an ast_strdupa'd string.
   (b) Reports can be generated with no report bodies. In particular, this
       occurs when a sender is transmitting information to a receiver (who
       will send no RTP back to the sender). As such, the sender has no report
       body for what it received. We now properly handle this case, and the
       sender will emit SR reports with no body. Likewise, if we receive an
       RTCP packet with no report body, we will still generate the appropriate
       events.

ASTERISK-24119 #close

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

11 years agores_pjsip_session: Fix race condition where redirecting information may not be set.
Joshua Colp [Tue, 29 Jul 2014 10:52:25 +0000 (10:52 +0000)] 
res_pjsip_session: Fix race condition where redirecting information may not be set.

Since the PJSIP INVITE session module is invoked before any session supplements it was
possible for it to handle a redirect before the res_pjsip_diversion module interpreted
and set redirecting information on the channel. This would cause the redirecting
information to get lost.

This patch ensures that session supplements are *always* invoked before a redirect occurs
by explicitly calling them in the redirect handler.

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

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

11 years agores_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity...
Joshua Colp [Tue, 29 Jul 2014 09:50:13 +0000 (09:50 +0000)] 
res_pjsip_pidf_body_generator / res_pjsip_xpidf_body_generator: Ensure local entity is unquoted.

The local entity as provided by PJSIP is quoted within '<' and '>'. As a result placing
this value into XML will result in malformed XML being produced. This patch now unquotes
the local entity so it can go safely into the XML.

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

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

11 years agodatastores: Audit ast_channel_datastore_remove usage.
Richard Mudgett [Mon, 28 Jul 2014 18:50:14 +0000 (18:50 +0000)] 
datastores: Audit ast_channel_datastore_remove usage.

Audit of v1.8 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leaks in app_speech_utils and func_frame_trace.

* Fixed app_speech_utils not locking the channel when accessing the
channel datastore list.

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

Audit of v11 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leak in func_jitterbuffer.  (Was not in v12)

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

Audit of v12 usage of ast_channel_datastore_remove() for datastore memory
leaks.

* Fixed leaks in abstract_jb.

* Fixed leak in ast_channel_unsuppress().  Used by ARI mute control and
res_mutestream.

* Fixed ref leak in ast_channel_suppress().  Used by ARI mute control and
res_mutestream.

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

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

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

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

11 years agoBlocked revisions 419631
Richard Mudgett [Fri, 25 Jul 2014 23:15:30 +0000 (23:15 +0000)] 
Blocked revisions 419631

........
features.c: Allow appliationmap to use Gosub.

Using DYNAMIC_FEATURES with a Gosub application as the mapped application
does not work.  It does not work because Gosub just pushes the current
dialplan context, exten, and priority onto a stack and sets the specified
Gosub location.  Gosub does not have a dialplan execution loop to run
dialplan like Macro.

* Made the DYNAMIC_FEATURES application mapping feature call
ast_app_exec_macro() and ast_app_exec_sub() for the Macro and Gosub
applications respectively.

* Backported ast_app_exec_macro() and ast_app_exec_sub() from v11 to
execute dialplan routines from the DYNAMIC_FEATURES application mapping
feature.

NOTE: This issue does not affect v12+ because it already does what this
patch implements.

AST-1391 #close
Reported by: Guenther Kelleter

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

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

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

11 years agoUpdate CHANGES for r419565
Matthew Jordan [Fri, 25 Jul 2014 14:46:15 +0000 (14:46 +0000)] 
Update CHANGES for r419565

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

11 years agoARI: report duration values in LiveRecording objects
Matthew Jordan [Fri, 25 Jul 2014 14:41:23 +0000 (14:41 +0000)] 
ARI: report duration values in LiveRecording objects

This patch adds three new fields to the LiveRecording model:
 - total_duration: the total length of the live recording
 - talking_duration: optional. The duration of talking energy that was
   detected while the recording was made.
 - silence_duration: optional. The duration of silence that was detected while
   the recording was made.

These values are reported in the RecordingFinished ARI event.

When a DSP is enabled on the channel during the recording - which occurs when
the recording is created with max_silence_seconds (indicating that the user
actually cares about how much silence is in the file), we will report the
talking_duration and silence_duration in addition to the total_duration.

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

ASTERISK-24037 #close
Reported by: Samuel Galarneau

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

11 years agoapp_bridgewait: Remove possibility of race condition between channels leaving/joining.
Joshua Colp [Fri, 25 Jul 2014 10:53:42 +0000 (10:53 +0000)] 
app_bridgewait: Remove possibility of race condition between channels leaving/joining.

Bridges created by app_bridgewait previously had the "dissolve when empty" flag set.
This caused the bridge core to destroy them when the last channel had left. This
introduced a race condition where we may have a reference to the bridge but it is
not actually joinable when we try to join it. This flag has now been removed and the
bridge is guaranteed to be joinable at all times.

ASTERISK-23987 #close
Reported by: Matt Jordan

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

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

11 years agobridge: Make "bridge destroy" only available in developer mode and add "all" to ...
Joshua Colp [Fri, 25 Jul 2014 10:49:06 +0000 (10:49 +0000)] 
bridge: Make "bridge destroy" only available in developer mode and add "all" to "bridge kick".

The "bridge destroy" CLI command is invasive to bridges and can leave them in an unexpected
state for the users of them. Since this command may be useful for developers it is now
only available when developer mode is available. To take its place "all" has been added
as a valid option to the "bridge kick" CLI command. It will kick all of the channels
in the bridge out.

ASTERISK-23987
Reported by: Matt Jordan

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

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

11 years agochan_sip: sip_subscribe_mwi_destroy should not call sip_destroy
Corey Farrell [Thu, 24 Jul 2014 17:57:46 +0000 (17:57 +0000)] 
chan_sip: sip_subscribe_mwi_destroy should not call sip_destroy

sip_subscribe_mwi_destroy calls sip_destroy on the reference counted
mwi->call.  This results in the fields of mwi->call being freed, but
mwi->call itself it leaked.  If other code is still using mwi->call
it can cause problems.  This change uses dialog_unref instead, to
balance the ref provided by sip_alloc().

ASTERISK-24087 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3834/
........

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

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

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

11 years agoDon't cause Asterisk to exit if ooh323.conf not found.
Jason Parker [Thu, 24 Jul 2014 16:50:41 +0000 (16:50 +0000)] 
Don't cause Asterisk to exit if ooh323.conf not found.

(closes issue ASTERISK-23814)
........

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

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

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

11 years agoendpoints: Fix failing unit tests from r419196
Matthew Jordan [Wed, 23 Jul 2014 16:45:15 +0000 (16:45 +0000)] 
endpoints: Fix failing unit tests from r419196

This patch does two things:
(1) It updates the unit tests to expect additional stasis messages. More
    messages are now sent to the endpoint topic, due to forwarding all
    channel messages and the forwarding relationship set up between
    endpoints themselves.
(2) Remove the technology forwarding subscription during
    ast_endpoint_shutdown. This prevents an improper double shutdown of
    an endpoint from occurring.

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

11 years agores_pjsip_refer: remove stray debugging line
Matthew Jordan [Wed, 23 Jul 2014 16:41:27 +0000 (16:41 +0000)] 
res_pjsip_refer: remove stray debugging line

How'd those @ symbols get in there...

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

11 years agoapp_voicemail: use a consistent generator string
Scott Griepentrog [Wed, 23 Jul 2014 13:58:57 +0000 (13:58 +0000)] 
app_voicemail: use a consistent generator string

When updating voicemail.conf when a user changes
their pin, change the generator string to be the
same as the module name when reading so that the
same config_hook will be called.

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

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

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

11 years agoARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech
Matthew Jordan [Tue, 22 Jul 2014 16:12:49 +0000 (16:12 +0000)] 
ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech

This patch serves two purposes:
(1) It fixes some bugs with endpoint subscriptions not reporting all of the
    channel events
(2) It serves as the preliminary work needed for ASTERISK-23692, which allows
    for sending/receiving arbitrary out of call text messages through ARI in a
    technology agnostic fashion.

The messaging functionality described on ASTERISK-23692 requires two things:
(1) The ability to send/receive messages associated with an endpoint. This is
    relatively straight forwards with the endpoint core in Asterisk now.
(2) The ability to send/receive messages associated with a technology and an
    arbitrary technology defined URI. This is less straight forward, as
    endpoints are formed from a tech + resource pair. We don't have a
    mechanism to note that a technology that *may* have endpoints exists.

This patch provides such a mechanism, and fixes a few bugs along the way.

The first major bug this patch fixes is the forwarding of channel messages
to their respective endpoints. Prior to this patch, there were two problems:
(1) Channel caching messages weren't forwarded. Thus, the endpoints missed
    most of the interesting bits (such as channel creation, destruction, state
    changes, etc.)
(2) Channels weren't associated with their endpoint until after creation.
    This resulted in endpoints missing the channel creation message, which
    limited the usefulness of the subscription in the first place (a major use
    case being 'tell me when this endpoint has a channel'). Unfortunately,
    this meant another parameter to ast_channel_alloc. Since not all channel
    technologies support an ast_endpoint, this patch makes such a call
    optional and opts for a new function, ast_channel_alloc_with_endpoint.

When endpoints are created, they will implicitly create a technology endpoint
for their technology (if one does not already exist). A technology endpoint is
special in that it has no state, cannot have channels created for it, cannot
be created explicitly, and cannot be destroyed except on shutdown. It does,
however, have all messages from other endpoints in its technology forwarded to
it.

Combined with the bug fixes, we now have Stasis messages being properly
forwarded. Consider the following scenario: two PJSIP endpoints (foo and bar),
where bar has a single channel associated with it and foo has two channels
associated with it. The messages would be forwarded as follows:

channel PJSIP/foo-1 --
                      \
                       --> endpoint PJSIP/foo --
                      /                         \
channel PJSIP/foo-2 --                           \
                                                  ---- > endpoint PJSIP
                                                /
channel PJSIP/bar-1 -----> endpoint PJSIP/bar --

ARI, through the applications resource, can:
 - subscribe to endpoint:PJSIP/foo and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2 and endpoint PJSIP/foo
 - subscribe to endpoint:PJSIP/bar and get notifications for channels
   PJSIP/bar-1 and endpoint PJSIP/bar
 - subscribe to endpoint:PJSIP and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2,PJSIP/bar-1 and endpoints PJSIP/foo,PJSIP/bar

Note that since endpoint PJSIP never changes, it never has events itself. It
merely provides an aggregation point for all other endpoints in its technology
(which in turn aggregate all channel messages associated with that endpoint).

This patch also adds endpoints to res_xmpp and chan_motif, because the actual
messaging work will need it (messaging without XMPP is just sad).

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

ASTERISK-23692

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

11 years agoFix more dev-mode build issues
Kinsey Moore [Tue, 22 Jul 2014 14:13:14 +0000 (14:13 +0000)] 
Fix more dev-mode build issues
........

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

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

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

11 years agoari: Add a copy operation for stored recordings
Matthew Jordan [Fri, 18 Jul 2014 21:25:59 +0000 (21:25 +0000)] 
ari: Add a copy operation for stored recordings

This patch adds a new operation for stored recordings, copy. It takes an
existing stored recording and makes a copy of it in the same directory
or a relative directory under the stored recording directory.

/ari/recordings/stored/{recordingName}/copy?destinationRecordingName={copy_name}

This is particularly useful for voicemail-esque applications, which may need to
copy or move recordings around a directory structure.

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

ASTERISK-24036 #close
Reported by: Sam Galarneau
Tested by: Sam Galarneau

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

11 years agostasis: fix call to ao2_t_alloc for stasis_message_router_create
Corey Farrell [Fri, 18 Jul 2014 21:24:03 +0000 (21:24 +0000)] 
stasis: fix call to ao2_t_alloc for stasis_message_router_create

This fixes a build failure introduced by r3821.  struct stasis_topic is
opaque, so topic->name is unavailable.  Switch to using stasis_topic_name().

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

11 years agostasis: use ao2_t_alloc for certain object allocators
Corey Farrell [Fri, 18 Jul 2014 19:53:31 +0000 (19:53 +0000)] 
stasis: use ao2_t_alloc for certain object allocators

Add tags to stasis objects using the name.  This makes it
easier to track the source of certain stasis ref leaks.

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

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

11 years agofunc_audiohookinherit.c: Fixup some XML documentation wording.
Richard Mudgett [Fri, 18 Jul 2014 16:46:35 +0000 (16:46 +0000)] 
func_audiohookinherit.c: Fixup some XML documentation wording.

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

11 years agoChannels: Masquerades to automatically move frame/audio hooks
Jonathan Rose [Fri, 18 Jul 2014 16:01:57 +0000 (16:01 +0000)] 
Channels: Masquerades to automatically move frame/audio hooks

Whenever possible, audiohooks and framehooks will now be copied over
to the channel that the masquerading channel gets cloned into. This
should occur for all audiohooks and most framehooks. As a result,
in Asterisk 12.5 and up, the AUDIOHOOK_INHERIT function is now
deprecated and its behavior is essentially the new default for all
audiohooks, plus some additional audiohooks/framehooks.

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

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

11 years agofeature_config: insure featuregroups and applicationmaps are initialized
Scott Griepentrog [Thu, 17 Jul 2014 22:17:33 +0000 (22:17 +0000)] 
feature_config: insure featuregroups and applicationmaps are initialized

If the features.conf is missing, the cfg->featurgroups
and cfg->applicationmaps is not initialized, resulting
in assert on ao2_find of a null container.  This patch
changes the initialization call and adds asserts for a
safeguard.

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

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

11 years agoTEST_FRAMEWORK: Fix threewaytransfer reporting
Kinsey Moore [Thu, 17 Jul 2014 14:27:40 +0000 (14:27 +0000)] 
TEST_FRAMEWORK: Fix threewaytransfer reporting

Ensure that three-way transfers can be reported even if featuremap is
non-NULL.

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

11 years agoRemove include of astobj.h from channels/dahdi/bridge_native_dahdi.c.
Corey Farrell [Wed, 16 Jul 2014 23:06:06 +0000 (23:06 +0000)] 
Remove include of astobj.h from channels/dahdi/bridge_native_dahdi.c.

The include was unneeded, this is split off from r3758 as it applies to 12.

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

11 years agores_pjsip: Support setting a default accountcode on endpoints
Matthew Jordan [Wed, 16 Jul 2014 13:58:07 +0000 (13:58 +0000)] 
res_pjsip: Support setting a default accountcode on endpoints

Most channel drivers let you specify a default accountcode to be set on
channels associated with a particular peer/endpoint/object. Prior to this
patch, chan_pjsip/res_pjsip did not support such a setting.

This patch adds a new setting to the res_pjsip endpoint object, 'accountcode'.
When a channel is created that is associated with an endpoint with this value
set, the channel will automatically have its accountcode property set to the
value configured for the endpoint.

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

ASTERISK-24000 #close
Reported by: Matt Jordan

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

11 years agoTEST_FRAMEWORK: Fix ref leak in feature activation
Kinsey Moore [Tue, 15 Jul 2014 23:03:04 +0000 (23:03 +0000)] 
TEST_FRAMEWORK: Fix ref leak in feature activation

This fixes two reference leaks that would occur when TEST_FRAMEWORK was
enabled and features were successfully executed.

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

11 years agomanager: Return ActionID on nominal responses to PresenceState action
Matthew Jordan [Tue, 15 Jul 2014 22:20:54 +0000 (22:20 +0000)] 
manager: Return ActionID on nominal responses to PresenceState action

When the PresenceState action is executed, the nominal path fails to include
the ActionID in the successful response. This patch adds a call to
astman_start_ack, which guarantees that an ActionID (if provided) will be
sent back to the AMI client.

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

ASTERISK-23985 #close
........

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

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

11 years agofunc_uri: URIENCODE/URIDECODE - allow empty strings as argument
Jonathan Rose [Tue, 15 Jul 2014 17:45:49 +0000 (17:45 +0000)] 
func_uri: URIENCODE/URIDECODE - allow empty strings as argument

Previously these two dialplan functions would issue warnings and
return failure when an empty string is used as the argument. Now
they will not issue a warning and will successfully return an
empty string.

ASTERISK-23911 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3745/
........

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

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

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

11 years agomedia formats: fix ref leak of peer for mwi subscription
Scott Griepentrog [Tue, 15 Jul 2014 17:14:57 +0000 (17:14 +0000)] 
media formats: fix ref leak of peer for mwi subscription

Holding a reference to the peer during mwi subscriptions
resulted in a circular reference because the final event
message would not be sent until destruction of the peer.

Instead, pass the name of the peer to the event callback
so that it can fail gracefully after the peer has gone.

ASTERISK-23959
Review: https://reviewboard.asterisk.org/r/3754/

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

11 years agologger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().
Richard Mudgett [Mon, 14 Jul 2014 14:46:11 +0000 (14:46 +0000)] 
logger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().

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

11 years agoastobj2: work around REF_DEBUG race which causes out of order log entries
Corey Farrell [Sun, 13 Jul 2014 21:55:41 +0000 (21:55 +0000)] 
astobj2: work around REF_DEBUG race which causes out of order log entries

* Update refcounter.py to use delta's to track the current reference count.
* Use result from internal_ao2_ref to write old_refcount to refs_log.

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

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

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

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

11 years agoFix minor reference leaks in app_skel and TEST_FRAMEWORK
Corey Farrell [Sun, 13 Jul 2014 16:44:56 +0000 (16:44 +0000)] 
Fix minor reference leaks in app_skel and TEST_FRAMEWORK

* Cleanup games object in app_skel.
* Cleanup stasis subscription to TEST_FRAMEWORK in manager.c (12+).

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

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

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

11 years agoastobj2: tweak ao2_replace to do nothing when it would be a NoOp
Corey Farrell [Fri, 11 Jul 2014 21:09:43 +0000 (21:09 +0000)] 
astobj2: tweak ao2_replace to do nothing when it would be a NoOp

This change causes ao2_replace to do nothing when src == dst. This
avoids REF_DEBUG logging when we're not actually doing anything.

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

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

11 years agoconfig: inform config hook of change when writing file
Scott Griepentrog [Fri, 11 Jul 2014 16:40:54 +0000 (16:40 +0000)] 
config: inform config hook of change when writing file

When updated configuration is written back to the conf
file - for example when a user changes their voicemail
pin, make sure that any config hook that wants to know
of changes is informed.

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

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

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

11 years agoinclude/asterisk/xmpp.h: Convert indentation to tabs
Matthew Jordan [Thu, 10 Jul 2014 15:35:53 +0000 (15:35 +0000)] 
include/asterisk/xmpp.h: Convert indentation to tabs

This is a whitespace only change.
........

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

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

11 years agochan_dahdi/sig_pri: Fix type mismatch in the idledial feature's channel creation.
Richard Mudgett [Thu, 10 Jul 2014 01:52:24 +0000 (01:52 +0000)] 
chan_dahdi/sig_pri: Fix type mismatch in the idledial feature's channel creation.

Square pegs in round holes don't work very well.
........

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

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

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

11 years agoARI: Make mixing bridges propagate linkedids and accountcodes.
Richard Mudgett [Wed, 9 Jul 2014 16:18:57 +0000 (16:18 +0000)] 
ARI: Make mixing bridges propagate linkedids and accountcodes.

* Create a Stasis bridge sub-class to propagate linkedids and
accountcodes.

* Fixed the basic bridge sub-class to update peeraccount codes when the
number of channels in the bridge drops back down to two parties.

* Refactored ast_bridge_channel_update_accountcodes() to handle channels
joining/leaving the bridge.

* Fixed the basic bridge sub-class to not call the base bridge class pull
method twice.

AFS-105 #close
ASTERISK-23852 #close
Reported by: Richard Mudgett

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

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

11 years agomanager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txt
Matthew Jordan [Tue, 8 Jul 2014 14:47:46 +0000 (14:47 +0000)] 
manager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txt

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

11 years agores_rtp_asterisk: Fix undefined function when PJPROJECT is not installed
Matthew Jordan [Tue, 8 Jul 2014 14:37:51 +0000 (14:37 +0000)] 
res_rtp_asterisk: Fix undefined function when PJPROJECT is not installed

The dtls_perform_handshake function was mistakenly placed under the guards for
USE_PJPROJECT. If PJPROJECT was not installed, the function would not be
defined, while other functions would attempt to still use it. This prevented
res_rtp_asterisk from being loaded.

ASTERISK-24001 #close
Reported by: Don Fanning

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

11 years agores_pjsip_dialog_info_body_generator: Add dialog-info+xml support for presence.
Joshua Colp [Mon, 7 Jul 2014 16:05:44 +0000 (16:05 +0000)] 
res_pjsip_dialog_info_body_generator: Add dialog-info+xml support for presence.

This module implements dialog-info+xml for the purposes of presence. This means
that phones such as Grandstreams can now subscribe to receive presence information
for an extension.

ASTERISK-21443 #close
Reported by: Matt Jordan

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

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

11 years agoARI/res_stasis: Subscribe to both Local channel halves when originating to app
Matthew Jordan [Mon, 7 Jul 2014 02:13:13 +0000 (02:13 +0000)] 
ARI/res_stasis: Subscribe to both Local channel halves when originating to app

This patch fixes two bugs:

1. When originating a channel into a Stasis application, we already create a
   subscription for the channel that is going into our Stasis app.
   Unfortunately, when you create a Local channel and pass it off to a Stasis
   app, you really aren't creating just one channel: you're creating two. This
   patch snags the second half of the Local channel pair (assuming it is a
   Local channel pair, but luckily core_local is kind about such assumptions)
   and subscribes to it as well.

2. Subscriptions are a bit sticky right now. If a subscription is made, the
   'interest' count gets bumped on the Stasis subscription - but unless
   something explicitly unsubscribes the channel, said subscription sticks
   around. This is not much of a problem is a user is creating the subscription
   - if they made it, they must want it. However, when we are creating
   implicit subscriptions, we need to make sure something clears them out.
   This patch takes a pessimistic approach: it watches the cache updates
   coming from Stasis and, if we notice that the cache just cleared out an
   object, we delete our subscription object. This keeps our ao2 container of
   Stasis forwards in an application from growing out of hand; it also is a
   bit more forgiving for end users who may not realize they were supposed to
   unsubscribe from that channel that just hung up.

Review: https://reviewboard.asterisk.org/r/3710/
ASTERISK-23939 #close

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

11 years agoCEL: Fix incorrect/missing extra field information
Kinsey Moore [Mon, 7 Jul 2014 01:18:58 +0000 (01:18 +0000)] 
CEL: Fix incorrect/missing extra field information

This corrects two issues with the extra field information in Asterisk
12+ in channel event logs.

It is possible to inject custom values into the dialstatus provided by
ast_channel_dial_type() Stasis messages that fall outside the
enumeration allowed for the DIALSTATUS channel variable. CEL now
filters for the allowed values and ignores other values.

The "hangupsource" extra field key is always blank if the far end
channel is a chan_pjsip channel. This is because the hangupsource is
never set for the pjsip channel driver. This change sets the
hangupsource whenever a hangup is queued for chan_pjsip channels.

This corrects an issue with the pjsip channel driver where the
hangupcause information was not being set properly.

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

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

11 years agoHTTP: Fix build for gcc 4.10
Kinsey Moore [Mon, 7 Jul 2014 01:00:46 +0000 (01:00 +0000)] 
HTTP: Fix build for gcc 4.10

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

11 years agochan_dahdi: Add inband_on_setup_ack compatibility option.
Richard Mudgett [Thu, 3 Jul 2014 22:06:02 +0000 (22:06 +0000)] 
chan_dahdi: Add inband_on_setup_ack compatibility option.

The new inband_on_setup_ack option causes Asterisk to assume inband audio
may be present when a SETUP_ACKNOWLEDGE message is received.

Q.931 Section 5.1.3 says that in scenarios with overlap dialing, when a
dialtone is sent from the network side, progress indicator 8 "Inband info
now available" MAY be sent to the CPE if no digits were received with the
SETUP.  It is thus implied that the ie is mandatory if digits came with
the SETUP and dialtone is needed.  This option should be enabled, when the
network sends dialtone and you want to hear it, but the network doesn't
send the progress indicator when needed.

NOTE: For Q.SIG setups this option should be enabled when outgoing overlap
dialing is also enabled because Q.SIG does not send the progress indicator
with the SETUP ACK.

The commit -r413714 (AST-1338) which causes this issue was dealing with a
SIP-to-ISDN interoperability issue.

This commit is a merge of the two patches indicated below.

ASTERISK-23897 #close
Reported by: Pavel Troller
Patches:
      pri-4.diff (license #6302) patch uploaded by Pavel Troller
      jira_asterisk_23897_v11.patch (license #5621) patch uploaded by rmudgett

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

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

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

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

11 years agores_ari: Fix some off-nominal paths just dropping the HTTP connection.
Richard Mudgett [Thu, 3 Jul 2014 19:00:09 +0000 (19:00 +0000)] 
res_ari: Fix some off-nominal paths just dropping the HTTP connection.

* Removed some incorrect newlines on ast_http_error() messages in
manager.c.

* Removed an incorrect newline in res_ari_channels.c.

Addendum to ASTERISK-23552

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

11 years agoHTTP: Add persistent connection support.
Richard Mudgett [Thu, 3 Jul 2014 16:16:16 +0000 (16:16 +0000)] 
HTTP: Add persistent connection support.

Persistent HTTP connection support is needed due to the increased usage of
the Asterisk core HTTP transport and the frequency at which REST API calls
are going to be issued.

* Add http.conf session_keep_alive option to enable persistent
connections.

* Parse and discard optional chunked body extension information and
trailing request headers.

* Increased the maximum application/json and
application/x-www-form-urlencoded body size allowed to 4k.  The previous
1k was kind of small.

* Removed a couple inlined versions of ast_http_manid_from_vars() by
calling the function.  manager.c:generic_http_callback() and
res_http_post.c:http_post_callback()

* Add missing va_end() in ast_ari_response_error().

* Eliminated unnecessary RAII_VAR() use in http.c:auth_create().

ASTERISK-23552 #close
Reported by: Scott Griepentrog

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

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

11 years agoARI: Improvements to body parameters documentation
Sam Galarneau [Thu, 3 Jul 2014 16:07:43 +0000 (16:07 +0000)] 
ARI: Improvements to body parameters documentation

The variables body parameter under the originate and originate with id
operations of the channel resource showed invalid JSON in its description.

The variables body parameter under the userEvent operation of the event
resource made no mention that the custom key/value pairs should be wrapped
in a variables key in order to be added to the custom user event.

ASTERISK-23975 #close

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

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

11 years agomain/untils: Prevent potential infinite loop in ast_careful_fwrite
Matthew Jordan [Thu, 3 Jul 2014 11:26:26 +0000 (11:26 +0000)] 
main/untils: Prevent potential infinite loop in ast_careful_fwrite

A loop in ast_careful_fwrite exists that will continually attempt to write to
a file stream, even in the presence of EAGAIN/EINTR errors. However, if a
connection that uses ast_careful_fwrite closes suddenly, ast_careful_fwrite's
call to fflush may return EAGAIN/EINTER along with EOF. A subsequent call to
fflush will return EOF but not clear errno, resulting in an infinite loop.

This patch clears errno after it is detected and handled the loop, such that
any subsequent call to fflush will not get erroneously stuck.

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

#ASTERISK-23984 #close
Reported by: Steve Davies
patches:
  fflush_loop_fix uploaded by one47 (License 5012)
........

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

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

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

11 years agores_rtp_asterisk: Don't leak memory or reset state if DTLS configuration is set multi...
Joshua Colp [Tue, 1 Jul 2014 14:40:24 +0000 (14:40 +0000)] 
res_rtp_asterisk: Don't leak memory or reset state if DTLS configuration is set multiple times.

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

11 years agoRecorded merge of revisions 417677 from http://svn.asterisk.org/svn/asterisk/branches/11
Joshua Colp [Mon, 30 Jun 2014 19:46:58 +0000 (19:46 +0000)] 
Recorded merge of revisions 417677 from http://svn.asterisk.org/svn/asterisk/branches/11

........
res_rtp_asterisk: Add SHA-256 support for DTLS and perform DTLS negotiation on RTCP.

This change fixes up DTLS support in res_rtp_asterisk so it can accept and provide
a SHA-256 fingerprint, so it occurs on RTCP, and so it occurs after ICE negotiation
completes. Configuration options to chan_sip and chan_pjsip have also been added to
allow behavior to be tweaked (such as forcing the AVP type media transports in SDP).

ASTERISK-22961 #close
Reported by: Jay Jideliov

Review: https://reviewboard.asterisk.org/r/3679/
Review: https://reviewboard.asterisk.org/r/3686/

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

11 years agochan_sip: be more tolerant of whitespace between attributes in SDP fmtp line
Matthew Jordan [Mon, 30 Jun 2014 03:25:59 +0000 (03:25 +0000)] 
chan_sip: be more tolerant of whitespace between attributes in SDP fmtp line

This patch is essentially a backport of a small portion of r397526 from
ASTERISK-21981. In that patch, pass through support and format attribute
negotiation was added for Opus. Part of that included being more tolerant to
whitespace in the fmtp line of an SDP; that part of the patch is being
applied here.

As the author of the backport pointed out, in SDP, the fmtp line is allowed to
include whitespace between attributes. RFC 3267 chapter 8.3 (from 2001)
includes an example for this. This was not removed in the updated RFC 4867 in
2007.

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

#ASTERISK-23916 #close
Reported by: Alexander Traud
patches:
  sdpFMTPspace_Asterisk11.patch uploaded by Alexander Traud (License 6520)
........

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

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

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

11 years agoevent.c: Fix type mismatch errors in ie_maps[].
Richard Mudgett [Fri, 27 Jun 2014 23:11:26 +0000 (23:11 +0000)] 
event.c: Fix type mismatch errors in ie_maps[].

In v12+ the type values from the table are only used by the CEL unit
tests.  Since the unit tests were only comparing a generated expected
event with a real event to see if the ie contents matched and using the
same table IE_PLTYPE values to read the event contents, the type
mismatches were not detected.

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

11 years agoEnsure REF_DEBUG records entrys for attempts to ao2_ref an invalid object
Corey Farrell [Fri, 27 Jun 2014 19:27:13 +0000 (19:27 +0000)] 
Ensure REF_DEBUG records entrys for attempts to ao2_ref an invalid object

This change ensures that __ao2_ref_debug writes to ref_log when given a
non-NULL pointer to an invalid ao2 object.  This is to ensure that we
record any attempt manipulate references of already freed objects.

ASTERISK-23948 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3677/
........

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

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

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

11 years agorefcounter.py: prevent use of excessive RAM with large refs logs
Corey Farrell [Fri, 27 Jun 2014 19:17:43 +0000 (19:17 +0000)] 
refcounter.py: prevent use of excessive RAM with large refs logs

When processing a 212MB refs file, refcounter.py used over 3GB of RAM.
This change greatly reduces memory usage in two ways:

* Saving object history in whole lines instead of separated values.
* Not saving normal/skewed/leaked object lists unless they are requested.

ASTERISK-23921 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3668/
........

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

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

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

11 years agores_pjsip: Add ActionID to events created as a result of PJSIP AMI actions
Matthew Jordan [Fri, 27 Jun 2014 13:48:12 +0000 (13:48 +0000)] 
res_pjsip: Add ActionID to events created as a result of PJSIP AMI actions

A number of various PJSIP AMI actions were failing to parse out and place the
ActionID into their responses. This patch updates the various PJSIP actions
such that the passed in ActionID is emitted on any event list complete events,
as well as any intermediate events created as a result of the action.

ASTERISK-23947 #close
Reported by: Mark Michelson

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

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

11 years agores_http_websocket: Export symbol for ast_websocket_set_timeout
Matthew Jordan [Thu, 26 Jun 2014 18:27:25 +0000 (18:27 +0000)] 
res_http_websocket: Export symbol for ast_websocket_set_timeout

Thanks to Sean Bright for pointing out that this was missed in #asterisk-dev.
........

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

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

11 years agochan_pjsip: Add a test event for fast picture updates
Matthew Jordan [Thu, 26 Jun 2014 17:16:44 +0000 (17:16 +0000)] 
chan_pjsip: Add a test event for fast picture updates

This will drive the test on review r3419. Note that the patch for this was
done by Ben Ford, although it was slightly modified for this commit.

ASTERISK-23562
Reported by: Matt Jordan

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

11 years agoudptl: Correct FEC to not consider negative sequence numbers as missing
Matthew Jordan [Thu, 26 Jun 2014 12:23:27 +0000 (12:23 +0000)] 
udptl: Correct FEC to not consider negative sequence numbers as missing

When using FEC, with span=3 and entries=4 Asterisk will attempt to repair
the packet with sequence number 5, as it will see that packet -4 is
missing. The result is Asterisk sending garbage packets that can kill a
fax.

This patch adds a check to see if the sequence number is valid before
checking if the packet is missing.

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

#ASTERISK-23908 #close
Reported by: Torrey Searle
patches:
  udptl_fec.patch uploaded by Torrey Searle (License 5334)
........

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

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

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

11 years agores_http_websocket: Close websocket correctly and use careful fwrite
Matthew Jordan [Thu, 26 Jun 2014 12:10:11 +0000 (12:10 +0000)] 
res_http_websocket: Close websocket correctly and use careful fwrite

When a client takes a long time to process information received from Asterisk,
a write operation using fwrite may fail to write all information. This causes
the underlying file stream to be in an unknown state, such that the socket
must be disconnected. Unfortunately, there are two problems with this in
Asterisk's existing websocket code:
1. Periodically, during the read loop, Asterisk must write to the connected
   websocket to respond to pings. As such, Asterisk maintains a reference to
   the session during the loop. When ast_http_websocket_write fails, it may
   cause the session to decrement its ref count, but this in and of itself
   does not break the read loop. The read loop's write, on the other hand,
   does not break the loop if it fails. This causes the socket to get in a
   'stuck' state, preventing the client from reconnecting to the server.
2. More importantly, however, is that the fwrite in ast_http_websocket_write
   fails with a large volume of data when the client takes awhile to process
   the information. When it does fail, it fails writing only a portion of
   the bytes. With some debugging, it was shown that this was failing in a
   similar fashion to ASTERISK-12767. Switching this over to ast_careful_fwrite
   with a long enough timeout solved the problem.

Note that this version of the patch, unlike r417310 in Asterisk 11, exposes
configuration options beyond just chan_sip's sip.conf. Configuration options
to configure the write timeout have also been added to pjsip.conf and ari.conf.

#ASTERISK-23917 #close
Reported by: Matt Jordan

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

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

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

11 years agochan_sip: Fix handling of "From" headers longer than 256 characters
Corey Farrell [Thu, 26 Jun 2014 10:05:20 +0000 (10:05 +0000)] 
chan_sip: Fix handling of "From" headers longer than 256 characters

From headers were processed using a 256 character buffer on the stack.
This change replaces that with a heap allocation by ast_strdup.

ASTERISK-23790 #close
Reported by: uniken1
Tested by: uniken1
Review: https://reviewboard.asterisk.org/r/3669/
Patches:
    chan_sip-large-from-header-1.8-r3.patch uploaded by wdoekes (license 5674)
........

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

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

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

11 years agoao2_container node object ignores REF_DEBUG in all places except one
Corey Farrell [Wed, 25 Jun 2014 18:56:09 +0000 (18:56 +0000)] 
ao2_container node object ignores REF_DEBUG in all places except one

Almost every reference operation against container node's uses
__ao2_alloc or __ao2_ref, thereby preventing ref logging for
the nodes.  One node reference is released with ao2_t_ref, causing
refcounter.py to falsely report skews and leaks for many nodes.

ASTERISK-23922 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3670/

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

11 years agores_rtp_asterisk: Return the length of data written when sending via ICE instead...
Joshua Colp [Mon, 23 Jun 2014 18:49:56 +0000 (18:49 +0000)] 
res_rtp_asterisk: Return the length of data written when sending via ICE instead of 0.

ASTERISK-23834 #close
Reported by: Richard Kenner
........

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

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

11 years agocore_unreal: Fix off by one buffer overwrite error.
Richard Mudgett [Mon, 23 Jun 2014 15:53:09 +0000 (15:53 +0000)] 
core_unreal: Fix off by one buffer overwrite error.

Appending the ;2 to the user supplied ;1 uniqueid to create the ;2 version
if the user did not also supply an extra uniqueid for the ;2 channel
resulted in allocating a buffer that was one byte too small.

* Fix off by one error in ast_unreal_new_channels() when generating the ;2
uniqueid from the user suppled ;1 version.

* Pulled some long assignment lines from if tests to improve line break
readability in ast_unreal_new_channels().

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

11 years agoastobj2: Add an ao2_replace macro to astobj2.h
George Joseph [Sun, 22 Jun 2014 18:44:23 +0000 (18:44 +0000)] 
astobj2: Add an ao2_replace macro to astobj2.h

This macro replaces one object reference with another cleaning up the original.

param dst Pointer to the object that will be cleaned up.
param src Pointer to the object replacing it.

src's ref count is bumped if it's non-NULL.
dst's ref count is decremented if it's non-NULL.
src is assigned to dst,

This patch was reviewed on IRC by coreyfarrell and mjordan.

Tested by: George Joseph

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

11 years agobuild: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.
George Joseph [Fri, 20 Jun 2014 23:16:43 +0000 (23:16 +0000)] 
build: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.

ast_ext_tool_check.m4 isn't handling cases where a path to a package is
provided (E.G. --with-mysqlclient=/some/sysroot) and the package has a config
tool (E.G. mysql_config) and the package has its own subdirectories in include
or lib.  For example, mysql's libraries are in ${MYSQLCLIENT_DIR}/usr/lib/mysql
but ast_ext_tool_check sets MYSQLCLIENT_LIB to ${MYSQLCLIENT_DIR}/usr/lib.
libxml2 has the same problem with its includes.  They're in
${LIBXML2_DIR}/usr/include/libxml2 not directly in ${LIBXML2_DIR}/usr/include.
Both cause configure to fail and there are others in the same boat.

The problem is caused by logic in ast_ext_tool_check that overrides the result
of the config tool's --cflags and --libs options if package_DIR is set.

This patch prepends package_DIR (if specified) to the -L and -I results from
the package's config tool instead of overriding them.

A regenerated ./configure and include/asterisk/autoconfig.h.in are included
but can be regenerated by running ./bootstrap.sh at any time.

Tested by: George Joseph
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3550/
........

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

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

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

11 years agobuild: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.
George Joseph [Fri, 20 Jun 2014 21:57:57 +0000 (21:57 +0000)] 
build: Allow autoconf/ast_ext_tool_check to handle cross-compiling better.

ast_ext_tool_check.m4 isn't handling cases where a path to a package is
provided (E.G. --with-mysqlclient=/some/sysroot) and the package has a config
tool (E.G. mysql_config) and the package has its own subdirectories in include
or lib.  For example, mysql's libraries are in ${MYSQLCLIENT_DIR}/usr/lib/mysql
but ast_ext_tool_check sets MYSQLCLIENT_LIB to ${MYSQLCLIENT_DIR}/usr/lib.
libxml2 has the same problem with its includes.  They're in
${LIBXML2_DIR}/usr/include/libxml2 not directly in ${LIBXML2_DIR}/usr/include.
Both cause configure to fail and there are others in the same boat.

The problem is caused by logic in ast_ext_tool_check that overrides the result
of the config tool's --cflags and --libs options if package_DIR is set.

This patch prepends package_DIR (if specified) to the -L and -I results from
the package's config tool instead of overriding them.

Tested by: George Joseph
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3550/
........

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

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

11 years agores_parking: Make manager commands register with module information
Jonathan Rose [Fri, 20 Jun 2014 20:46:28 +0000 (20:46 +0000)] 
res_parking: Make manager commands register with module information

Previously module information was not included due to an oversight.

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

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

11 years agoastobj2: Additional refactoring to push impl specific code down into the impls.
George Joseph [Fri, 20 Jun 2014 15:22:44 +0000 (15:22 +0000)] 
astobj2: Additional refactoring to push impl specific code down into the impls.

Move some implementation specific code from astobj2_container.c into
astobj2_hash.c and astobj2_rbtree.c.  This completely removes the need for
astobj2_container to switch on RTTI and it no longer has any knowledge of
the implementation details.

Also adds AO2_DEBUG as a new compile option in menuselect which controls
astobj2 debugging independently of AST_DEVMODE and REF_DEBUG.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3593/

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

11 years agopjsip cli: Change Identify to show CIDR notation instead of netmasks.
George Joseph [Thu, 19 Jun 2014 20:12:15 +0000 (20:12 +0000)] 
pjsip cli: Change Identify to show CIDR notation instead of netmasks.

* Added ast_sockaddr_cidr_bits() to count the 1 bits in an ast_sockaddr.
* Added ast_ha_join_cidr() which uses ast_sockaddr_cidr_bits() for the netmask
  instead of ast_sockaddr_stringify_addr.
* Changed res_pjsip_endpoint_identifier_ip to call ast_ha_join_cidr() instead
  of ast_ha_join() for the CLI output.

This is a CLI change only.  AMI was not affected.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3652/

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

11 years agoFix build warnings with TEST_FRAMEWORK enabled
Kinsey Moore [Thu, 19 Jun 2014 19:35:52 +0000 (19:35 +0000)] 
Fix build warnings with TEST_FRAMEWORK enabled
........

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

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

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

11 years agoRemove the problematic and unneeded AST_MODFLAG_GLOBAL_SYMBOLS from pbx_lua.c
George Joseph [Thu, 19 Jun 2014 16:03:17 +0000 (16:03 +0000)] 
Remove the problematic and unneeded AST_MODFLAG_GLOBAL_SYMBOLS from pbx_lua.c

AST_MODFLAG_GLOBAL_SYMBOLS was causing the module to be incorrectly loaded
before pbx_config.  pbx_config was therefore blowing away contexts that were
created by pbx_lua.  With AST_MODFLAG_DEFAULT the load order is now correct
and contexs are being properly merged.  AST_MODFLAG_GLOBAL_SYMBOLS was not
needed anyway since no other modules needed its global symbols that early.

ASTERISK-23818 #close
Reported by: Dennis Guse
Tested by: Dennis Guse
Tested by: George Joseph

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

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

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

11 years agoUpdate extensions.lua.sample with naming conflict guidance.
George Joseph [Wed, 18 Jun 2014 17:09:04 +0000 (17:09 +0000)] 
Update extensions.lua.sample with naming conflict guidance.

The sample extensions.lua was causing pbx_lua to fail to load when parsing
'app.goto("default", "s", 1)' because in Lua 5.2, 'goto' is now a reserved
word.  This patch adds guidance to extensions.lua.sample and changed
'app.goto("default", "s", 1)' to 'app.['goto']("default", "s", 1)'.

ASTERISK-23844 #close
Reported by: rnewton
Tested by: gtjoseph
Review: https://reviewboard.asterisk.org/r/3627/

........

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

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

11 years agostasis_channels: Update the stasis cache if manager variables are needed
Matthew Jordan [Wed, 18 Jun 2014 04:16:55 +0000 (04:16 +0000)] 
stasis_channels: Update the stasis cache if manager variables are needed

In r416211, the publishing of variable changes was modified such that a
cached channel snapshot was used if manager variables were not requested
with each AMI event. This was done to reduce the amount of channel snapshots
created.

However, an assumption was made that generating a channel snapshot and
publishing the snapshot to the channel topic was sufficient to ensure that
the cache would be updated; this is not the case. The channel snapshot type
must be used to force a snapshot update.

This patch updates the publication of channel variables such that the cache
is updated prior to publication of the channel variable message if manager
variables are in use. This ensures that all AMI events receive the variable
update when they are supposed to.

Note that this issue was caught by the Asterisk Test Suite (go go testing)

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

11 years agoAllow the PUSH and UNSHIFT functions to set inheritable channel variables.
Mark Michelson [Tue, 17 Jun 2014 18:43:56 +0000 (18:43 +0000)] 
Allow the PUSH and UNSHIFT functions to set inheritable channel variables.
........

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

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

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

11 years agoFix string growth algorithm for XML presence bodies.
Mark Michelson [Tue, 17 Jun 2014 16:33:13 +0000 (16:33 +0000)] 
Fix string growth algorithm for XML presence bodies.

pjpidf_print() does not return < 0 if there is not enough
room for the document to be printed. Rather, it returns
39, the length of the XML prolog.

The algorithm also had a bug in that it would return if
it attempted to grow the string larger.

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

11 years agoMoH: Don't restart stream on repeated start calls
Kinsey Moore [Tue, 17 Jun 2014 16:26:10 +0000 (16:26 +0000)] 
MoH: Don't restart stream on repeated start calls

Currently, music on hold will stop and then start again from the
beginning if ast_moh_start() is called multiple times. This can happen
if a call is put on hold repeatedly (the channel receives multiple
HOLD control frames) and can be triggered from ARI by starting MoH on a
channel multiple times. This is fairly jarring/annoying to users.

This change prevents MoH from being restarted if the requested music
class is the same as the one currently playing.

This includes an extra check to prevent the errors previously
experienced in the testsuite and has 100+ test runs behind it.

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

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

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

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