Commit Graph

25510 Commits

Author SHA1 Message Date
Mark Michelson 688bb204dc Reverse logic during subscription persistence recreation.
In the abstraction effort, this bit of logic got messed up. We
want to recreate the persistence if things go well, not if things
fail.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-30 18:39:56 +00:00
Matthew Jordan b99c1378bc apps/app_voicemail: Fix compilation error introduced in r417591
Not sure why that change to ast_channel_alloc was made but ... okay.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-30 13:02:43 +00:00
Matthew Jordan af90afd90c app_voicemail, say: Add support for Japanese Language
This patch adds support for the Japanese language to both the say family of
applications, as well as for VoiceMail and VoiceMailMain. A new pack of
language sounds will be released at the same time as the next major version
of Asterisk to support the new language features.

The language features can be enabled using a language code of 'ja'.

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

ASTERISK-23324 #close
Reported by: Kevin McCoy
patches:
  app_voicemail.c.20140226.jb.patch uploaded by Kevin McCoy (License 6586)
  say.c.20140226.jb.patch uploaded by Kevin McCoy (License 6586)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-30 04:00:19 +00:00
Matthew Jordan 44dba37bd1 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-30 03:27:00 +00:00
Richard Mudgett 3148dfbd11 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.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-27 23:21:44 +00:00
Corey Farrell 024316fa3a 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-27 19:27:59 +00:00
Corey Farrell 9a495107b8 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-27 19:18:32 +00:00
Matthew Jordan 15dcaeef82 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-27 13:50:02 +00:00
Kinsey Moore 512e505dc3 CEL: Update unit tests for bridge tech field
Update the CEL unit tests that handle BRIDGE_ENTER and BRIDGE_EXIT
events to expect the "bridge_technology" extra field key.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-27 02:04:50 +00:00
Kinsey Moore 1337daf88a CHANGES: Add missing changes
Add missing CHANGES changes from r417361 and r417383.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 19:15:10 +00:00
Matthew Jordan 435d20201c 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 18:27:53 +00:00
Matthew Jordan 299e255aa9 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 17:17:25 +00:00
Kinsey Moore 6145a57c83 CEL: Add bridge tech to relevant CEL records
Add the "bridge_technology" extra field key to BRIDGE_ENTER and
BRIDGE_EXIT CEL events to convey the bridge technology in use at the
time the record was generated.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 14:48:21 +00:00
Kinsey Moore e977b7936b Bridging: Allow channels to define bridging hooks
This patch allows the current owner of a channel to define various
feature hooks to be made available once the channel has entered a
bridge. This includes any hooks that are setup on the
ast_bridge_features struct such as DTMF hooks, bridge event hooks
(join, leave, etc.), and interval hooks.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 12:43:47 +00:00
Matthew Jordan 22e62ac6f6 app_jack: Support audio with a sampling rate higher than 8kHz
This patch enables the jack-audiohook to cope with dynamic sampling rates from
and to Asterisk. Information from the channel is taken to derive the channel's
sampling rate, suiting SLINxx format and frame->datalen.

There are stil a few limitations after this patch:
* Required information is taken from the channel during initialization as
  the audiohook does not provide this information.
  Audiohook.internal_sampl_rate(...) is set later, but no callback is available
  to inform app_jack.

* Frame.datalen is computed using "rate / 50" assuming a ptime of 20ms.
  There is no internal API available to determine datalen for a SLINxx.

* Ringbuffer size is now dynamic depending on the value of frame.datalen
  (see above) and the number of frames, which are in RINGBUFFER_FRAME_CAPACITY,
  that need to fit.

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

Note that the patch being committed here is based on the patch posted on
ASTERISK-23836. However, Matthis Schmieder also provided a patch to enable
this functionality, and that patch is noted below.

ASTERISK-20696 #close
Reported by: Matthis Schmieder
patches:
  app_jack.patch uploaded by Matthis Schmieder (License 6445)

ASTERISK-23836 #close
Reported by: Dennis Guse
patches:
  patch-app_jack.c uploaded by Dennis Guse (License 6513)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 12:43:05 +00:00
Matthew Jordan f27074eeb7 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 12:24:25 +00:00
Matthew Jordan 365ae7523b 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 12:21:14 +00:00
Corey Farrell d171e0b2e9 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-26 10:06:13 +00:00
Mark Michelson bc8c08c609 Abstract PJSIP-specific elements from the pubsub API.
This helps to pave the way for RLS work that is to come.
Since this is a self-contained change and subscription
tests still pass, this work is being committed directly
to trunk instead of a working branch.

ASTERISK-23865 #close
Review: https://reviewboard.asterisk.org/r/3628



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25 20:57:28 +00:00
Corey Farrell 4a7a36a0a1 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25 18:57:04 +00:00
Damien Wedhorn 48c88db167 Skinny: cleanup some log messages around sessions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-25 00:45:07 +00:00
Corey Farrell db6a8a6347 Move eid functions to utils.c, mark netsock.h deprecated
Move eid functions from netsock.c to utils.c.  These functions were
already published by utils.h.  Flag netsock.h as deprecated and switch
res_pjsip_session.h to use netsock2.h.  The only code that still uses
netsock.h is chan_iax2.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-24 02:50:15 +00:00
Joshua Colp d5ca5b7f8f 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23 18:50:18 +00:00
Richard Mudgett eb2aded25c 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().
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23 16:04:33 +00:00
Tzafrir Cohen 3451d6a72d suspended destructions of pri spans on events
If a DAHDI span disappears, we wish for its representation in Asterisk
to be destroyed as well.

The information about the span's removal may come from several paths:

1. DAHDI sends DAHDI_EVENT_REMOVE on every channel.
2. An extra DAHDI_EVENT_REMOVED is sent on every subsequent call to
   DAHDI_GET_EVENT.
3. Every read (including the internal one by libpri on the D-channel)
   returns -ENODEV.

Asterisk responsds to DAHDI_EVENT_REMOVE on a channel by destroying it.

Destroying a channel requires holding the channel list lock (iflock).
Destroying a channel that is part of a span requires holding the span's
lock. Destroying a channel from a context that holds the span lock,
while at the same time another channel is destroyed directly, leads to a
deadlock. Solution: don't destroy span while holding the channels list
lock.

Thus changes in this patch:
* Deferring removal of PRI spans in response to events: doomed spans
  are collected on a list.
* Doomed spans are removed periodically by the monitor thread.
* ENODEV reads from the D-channel will warant the same deferred removal.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-23 07:44:19 +00:00
George Joseph 682357dced 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-22 18:53:26 +00:00
George Joseph 1a6db55404 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20 23:18:36 +00:00
George Joseph 988eb0f82f 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20 21:59:08 +00:00
Jonathan Rose a8cb4924cb 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20 20:57:46 +00:00
Jonathan Rose e087ae0c02 Logger: Add manager command 'LoggerRotate' to rotate logger
Part of a series of AMI command equivalents to existing CLI
commands

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20 20:29:45 +00:00
Richard Mudgett 86e8ab5ed4 voicemail API callbacks: Extract the sayname API call to its own registerd callback.
* Extract the sayname API call to its own registerd callback.  This allows
the app_directory and app_chanspy applications to say a mailbox owner's
name using an alternate provider when app_voicemail is not available
because you are using res_mwi_external.  app_directory still uses the
voicemail.conf file.

AFS-64 #close
Reported by: Mark Michelson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20 17:06:42 +00:00
George Joseph 577632dec9 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-20 15:27:43 +00:00
George Joseph d87f8c429e 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/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19 20:13:20 +00:00
Kinsey Moore bd36288efa 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19 19:40:45 +00:00
George Joseph 67021bfa07 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-19 16:04:36 +00:00
George Joseph cc4178bf25 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-18 17:20:13 +00:00
Matthew Jordan a965613cf7 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)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-18 04:22:05 +00:00
Mark Michelson fc52fd8884 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-17 18:45:11 +00:00
Mark Michelson 351db2033c 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.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-17 16:35:04 +00:00
Kinsey Moore 163c734ae7 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
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-17 16:33:53 +00:00
Richard Mudgett 0c896d8b9b chan_dahdi: Adds support for major update to libss7.
* SS7 support now requires libss7 v2.0 or later.  The new libss7 is not
backwards compatible.

* Added SS7 support for connected line and redirecting.

* Most SS7 CLI commands are reworked as well as new SS7 commands added.
See online CLI help.

* Added several SS7 config option parameters described in
chan_dahdi.conf.sample.

* ISUP timer support reworked and now requires explicit configuration.
See ss7.timers.sample.

Special thanks to Kaloyan Kovachev for his support and persistence in
getting the original patch by adomjan updated and ready for release.

SS7-27 #close
Reported by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16 18:27:51 +00:00
Kevin Harwell bd0aa4fb04 res_http_websocket: read/write string fixup
There was a problem when reading a string from the websocket. It assumed the
received data had a null terminator and tried to write the data to an ast_str.
This of course could/would read past the end of the given buffer while
writing the data to the internal buffer of ast_str. Modified the the code to
correctly place a null terminator on the result string.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16 16:22:33 +00:00
Igor Goncharovskiy a1e0a5e4b0 We have faced situation when using CDR and CEL by sqlite3 modules. With system having high load (~100 concurrent calls created by sipp) we found many cdr and cel records missed. There is special finction in sqlite3, that make able to fix this situation - sqlite3_wait_timeout, that also can replace awful code cdr_sqlite3 ad cel_sqlite3 modules. Also this function can be used for aastdb and res_config_sqlite3 to avoid missed writes to sqlite db.
#ASTERISK-23766 #close
Reported by: Igor Goncharovsky

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16 09:04:05 +00:00
Matthew Jordan 8313964d72 channels/chan_sip: Forbid remote bridging if T.38 is negotiated
When a framehook is removed - such as the fax gateway framehook - the bridge
framework will re-evaluate the bridge mixing technologies to see if it can
improve the bridging. When this occurs, get_rtp_info will be called to
determine if local or remote bridging can be used. Using remote bridging
will cause a fax to fail, as direct media negotiation will cause some small
number of packets to not arrive at the remote endpoint.

This patch forces local native bridging if T.38 negotiation is in progress or
has been established.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16 02:40:44 +00:00
Matthew Jordan 072b61bbed channel_internal_api: Publish a snapshot change when linkedids change
Snapshots are now not published *quite* as much as they used to. One instance
where they are not published any longer is during bridge enter and exit - the
state of the channel doesn't change, the bridge does. However, channels are
changed when a linkedid is propagated; previously, the channel's state would
be updated and published during the bridge enter event. Now this must be
explicitly done.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-15 22:12:49 +00:00
Matthew Jordan 705d0c3e81 test_stasis_endpoints: Remove expected channel snapshot
We no longer publish a channel snapshot when it is associated with an endpoint;
after all, the channel itself hasn't changed - the endpoint state has changed.
This updates the channel_messages unit test accordingly.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-15 21:42:45 +00:00
Matthew Jordan b52c6d0903 MoH: Undo commit r416150 (1.8)
This patch reverts r416150. When the comparison between mohclass->name and
state->class->name is made, you are not guaranteed that (a) state->class is
non-NULL or that state or state->class are in a safe state.

Crashes caught by the bridges/transfer_capabilities test.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-15 21:24:04 +00:00
Corey Farrell eade1d490c res_manager_devicestate and res_manager_presencestate missing support level
Add MODULEINFO comment block to define support level core for these new
modules.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-14 19:26:16 +00:00
Matthew Jordan 9cc1a8e893 stasis: Reduce creation of channel snapshots to improve performance
During some performance testing of Asterisk with AGI, ARI, and lots of Local
channels, we noticed that there's quite a hit in performance during channel
creation and releasing to the dialplan (ARI continue). After investigating
the performance spike that occurs during channel creation, we discovered
that we create a lot of channel snapshots that are technically unnecessary.
This includes creating snapshots during:
 * AGI execution
 * Returning objects for ARI commands
 * During some Local channel operations
 * During some dialling operations
 * During variable setting
 * During some bridging operations
And more.

This patch does the following:
 - It removes a number of fields from channel snapshots. These fields were
   rarely used, were expensive to have on the snapshot, and hurt performance.
   This included formats, translation paths, Log Call ID, callgroup, pickup
   group, and all channel variables. As a result, AMI Status,
   "core show channel", "core show channelvar", and "pjsip show channel" were
   modified to either hit the live channel or not show certain pieces of data.
   While this is unfortunate, the performance gain from this patch is worth
   the loss in behaviour.
 - It adds a mechanism to publish a cached snapshot + blob. A large number of
   publications were changed to use this, including:
   - During Dial begin
   - During Variable assignment (if no AMI variables are emitted - if AMI
     variables are set, we have to make snapshots when a variable is changed)
   - During channel pickup
   - When a channel is put on hold/unhold
   - When a DTMF digit is begun/ended
   - When creating a bridge snapshot
   - When an AOC event is raised
   - During Local channel optimization/Local bridging
   - When endpoint snapshots are generated
   - All AGI events
   - All ARI responses that return a channel
   - Events in the AgentPool, MeetMe, and some in Queue
 - Additionally, some extraneous channel snapshots were being made that were
   unnecessary. These were removed.
 - The result of ast_hashtab_hash_string is now cached in stasis_cache. This
   reduces a large number of calls to ast_hashtab_hash_string, which reduced
   the amount of time spent in this function in gprof by around 50%.

#ASTERISK-23811 #close
Reported by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13 18:24:49 +00:00
Kinsey Moore 0acc626530 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.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-13 13:11:38 +00:00