Commit Graph

1881 Commits

Author SHA1 Message Date
Matthew Jordan 8fb5bdce9a Prevent exhaustion of system resources through exploitation of event cache
Asterisk maintains an internal cache for devices in the event subsystem. The
device state cache holds the state of each device known to Asterisk, such that
consumers of device state information can query for the last known state for
a particular device, even if it is not part of an active call. The concept of
a device in Asterisk can include entities that do not have a physical
representation. One way that this occurred was when anonymous calls are allowed
in Asterisk. A device was automatically created and stored in the cache for
each anonymous call that occurred; this was possible in the SIP and IAX2
channel drivers and through channel drivers that utilized the
res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices
are never removed from the system, allowing anonymous calls to potentially
exhaust a system's resources.

This patch changes the event cache subsystem and device state management to
no longer cache devices that are not associated with a physical entity.

(issue ASTERISK-20175)
Reported by: Russell Bryant, Leif Madsen, Joshua Colp
Tested by: kmoore
patches:
  event-cachability-3.diff uploaded by jcolp (license 5000)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:11:59 +00:00
Matthew Jordan 1fb06fde95 Resolve crashes due to large stack allocations when using TCP
Asterisk had several places where messages received over various network
transports may be copied in a single stack allocation. In the case of TCP,
since multiple packets in a stream may be concatenated together, this can
lead to large allocations that overflow the stack.

This patch modifies those portions of Asterisk using TCP to either
favor heap allocations or use an upper bound to ensure that the stack will not
overflow:
 * For SIP, the allocation now has an upper limit
 * For HTTP, the allocation is now a heap allocation instead of a stack
   allocation
 * For XMPP (in res_jabber), the allocation has been eliminated since it was
   unnecesary.

Note that the HTTP portion of this issue was independently found by Brandon
Edwards of Exodus Intelligence.

(issue ASTERISK-20658)
Reported by: wdoekes, Brandon Edwards
Tested by: mmichelson, wdoekes
patches:
  ASTERISK-20658_res_jabber.c.patch uploaded by mmichelson (license 5049)
  issueA20658_http_postvars_use_malloc2.patch uploaded by wdoekes (license 5674)
  issueA20658_limit_sip_packet_size3.patch uploaded by wdoekes (license 5674)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 15:39:42 +00:00
Sean Bright 1e51b9eaa1 Make generate_exchange_uuid() always return the passed ast_str pointer.
I changed this code earlier to return NULL if it wasn't able to generate a UUID,
whereas the earlier code would always return the ast_str that was passed in.
Switch back to returning the ast_str, only set it to the empty string instead if
UUID generation fails.  We still do a validity check later which will catch this
and blow up if necessary.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 21:20:32 +00:00
Sean Bright d33e46a47f Use the UUID API to generate and validate UUIDs for res_calendar_exchange.
Currently the res_calendar_exchange module uses its own method of generating
UUIDs using ast_random().  Now that we have a UUID API we should use that
instead.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 15:37:55 +00:00
Mark Michelson 609ffb429a The UUID commit removed changes made in res_clialiases.c
This puts back in the changes that are designed to work
around a memory leak fix in the CLI code.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-13 15:37:45 +00:00
Mark Michelson 8cb156bfc1 Add UUID support to Asterisk.
This provides a common API for dealing with unique identifiers.
The API provides methods to create, parse, copy, and stringify UUIDs.

An accompanying unit test is provided that tests all operations.

(closes issue ASTERISK-20726)
reported by Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 21:04:45 +00:00
Mark Michelson 619de7f012 Fix crash that can occur if CLI registration fails for an aliased command.
A recent memory leak fix in main/cli.c causes an ast_cli_entry's command
field to be freed and NULLed if ast_cli_register() fails. res_clialiases
was ignoring the return value of ast_cli_register() and was then passing
the NULL command off to a a hash function. This resulted in a crash.

The fix is not to ignore the erroneous return value. If ast_cli_register()
fails, then we do not continue trying to process the current alias.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 20:53:34 +00:00
Kinsey Moore 34cbefe62f Ensure ReceiveFax provides a CED tone via T.38
When using res_fax_digium, the T.38 CED tone was not being provided
properly which would cause some incoming faxes to fail. This was not an
issue with res_fax_spandsp since it does not strictly honor the
send_ced flag and sends the CED tone whenever receiving a T.38 fax.

(closes issue FAX-343)
Reported-by: Benjamin Tietz
Patch-by: Kinsey Moore
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-10 16:56:37 +00:00
Jonathan Rose d7372766dc res_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session
When srtp_create fails, the session may be dealloced or just not alloced. At
the same time though, the session pointer might not be set to NULL in this
process and attempting to srtp_dealloc it again will cause a segfault. This
patch checks for failure of srtp_create and sets the session pointer to NULL
if it fails.

(closes issue ASTERISK-20499)
Reported by: tootai
Review: https://reviewboard.asterisk.org/r/2228/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-05 17:17:06 +00:00
Olle Johansson e3faeb67e8 Formatting fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 16:45:49 +00:00
Olle Johansson 1b47dbe991 Formatting changes
Found a large amount of missing {} in the code before patching in another branch


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03 09:35:55 +00:00
David M. Lee cc01a79463 Added missing newlines to websocket ast_logs.
Without these newlines, log messages just continue tacking onto the same
line, and do not flush immediately.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-20 22:06:05 +00:00
Joshua Colp 866d968149 Remove a fixed size limitation for producing SDP and change how ICE support is disabled by default.
With ICE support enabled in chan_sip and a large number of interfaces on the system it was
possible for the produced SDP to be truncated due to some fixed size buffers. These buffers
have now been changed so they will dynamically grow as needed.

ICE support is now also enabled by default in res_rtp_asterisk to provide a smoother experience
for chan_motif users where it is required. To maintain the previous behavior in chan_sip it is
no longer enabled by default there.

(closes issue ASTERISK-20643)
Reported by: coopvr
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-11 17:15:47 +00:00
Mark Michelson e773bbdd10 Fix a "set but not used" warning on newer gccs.
Turns out the "helpful" setting of ms and res in this
macro is completely useless after the timeout antipattern
fix.

If you're a new guy looking to write code, don't write
a macro like this one.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-08 22:10:29 +00:00
Mark Michelson f2bb9afe17 Multiple revisions 375993-375994
........
  r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines
  
  Fix misuses of timeouts throughout the code.
  
  Prior to this change, a common method for determining if a timeout
  was reached was to call a function such as ast_waitfor_n() and inspect
  the out parameter that told how many milliseconds were left, then use
  that as the input to ast_waitfor_n() on the next go-around.
  
  The problem with this is that in some cases, submillisecond timeouts
  can occur, resulting in the out parameter not decreasing any. When this
  happens thousands of times, the result is that the timeout takes much
  longer than intended to be reached. As an example, I had a situation where
  a 3 second timeout took multiple days to finally end since most wakeups
  from ast_waitfor_n() were under a millisecond.
  
  This patch seeks to fix this pattern throughout the code. Now we log the
  time when an operation began and find the difference in wall clock time
  between now and when the event started. This means that sub-millisecond timeouts
  now cannot play havoc when trying to determine if something has timed out.
  
  Part of this fix also includes changing the function ast_waitfor() so that it
  is possible for it to return less than zero when a negative timeout is given
  to it. This makes it actually possible to detect errors in ast_waitfor() when
  there is no timeout.
  
  (closes issue ASTERISK-20414)
  reported by David M. Lee
  
  Review: https://reviewboard.asterisk.org/r/2135/
........
  r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines
  
  Remove some debugging that accidentally made it in the last commit.
........

Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 19:15:26 +00:00
Matthew Jordan a0c363e227 Refactor ast_timer_ack to return an error and handle the error in timer users
Currently, if an acknowledgement of a timer fails Asterisk will not realize
that a serious error occurred and will continue attempting to use the timer's
file descriptor.  This can lead to situations where errors stream to the
CLI/log file.  This consumes significant resources, masks the actual problem
that occurred (whatever caused the timer to fail in the first place), and
can leave channels in odd states.

This patch propagates the errors in the timing resource modules up through
the timer core, and makes users of these timers handle acknowledgement
failures.  It also adds some defensive coding around the use of timers
to prevent using bad file descriptors in off nominal code paths.

Note that the patch created by the issue reporter was modified slightly for
this commit and backported to 1.8, as it was originally written for
Asterisk 10.

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

(issue ASTERISK-20032)
Reported by: Jeremiah Gowdy
patches:
  jgowdy-timerfd-6-22-2012.diff uploaded by Jeremiah Gowdy (license 6358)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 23:10:14 +00:00
Matthew Jordan 069f5f8b93 Only deref a reserved gateway session if we actually reserved one
Its perfectly acceptable to have a gateway session unreserved when we go to
first allocate one.  Unreffing the reserved gateway session - when its NULL -
will result in an assertion error.

This problem was caught by the Asterisk Test Suite (once we had enough of the
debugging flags enabled)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 02:44:35 +00:00
Joshua Colp 6de0b18b3b Fix an issue with res_http_websocket where the chan_sip WebSocket handler could not be registered.
On some systems the optional API support uses the GCC compiler attribute "weakref" to provide its
functionality. This code changes the function names and prefixes "__" to the front. The
res_http_websocket exports file did not take this into account, thereby not allowing those functions
to be global and ultimately found.

(closes issue ASTERISK-20631)
Reported by: danjenkins
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-31 18:01:09 +00:00
Matthew Jordan 05cee7b717 Properly extract the Body information of an EWS calendar item
Unlike all other calendar modules, res_calendar_ews fails to extract the Body
information for a calendar item.  This is due, in part, to a quirk in the
schema in the XML - not only does a CalendarItem contain a Body element, but
the CalendarItem exists as a descendant of a different Body element.  The neon
parser was erroneously skipping all Body elements.

This patch fixes that by bypassing Body elements that are not a child of
CalendarItem, and parsing the Body element out if it is a child.

Note that the original patch by Terry Wilson only needed slight modifications
to make it properly pull the Body information out; as such, while I've linked
to the patch that I uploaded for Dmitry, I've attributed the patch to Terry.

(closes issue ASTERISK-19738)
Reported by: Dmitry Burilov
Tested by: Dmitry Burilov
patches:
  calendar_ews_body_2012_10_29.diff uploaded by Terry Wilson (license 6283)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-31 14:58:44 +00:00
Walter Doekes 6d57ecd48c Change a few warnings to debug and the inverse.
Remove the "RTP Read too short" warning for RTP keepalives. Remove the
the warning about the application delimiter switch from pipe to comma.
(You should've done this by now.) Make cdr_odbc report more when an
insert fails. Make chan_sip warn less when the peer wants SRTP (and we
don't) or sends a zero port to disable a media type.

Review: https://reviewboard.asterisk.org/r/2167
(closes issue ASTERISK-20538)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 14:24:52 +00:00
Andrew Latham c7857504df Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking to the resource.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:44:27 +00:00
Matthew Jordan 3620fcff36 Disable ICE support by default
Since there are a number of legacy devices out there that fail to handle ICE
candidates properly (which is a nice way of saying something much uglier),
disable it by default.

Support for ICE candidates can be enabled in rtp.conf using the icesupport
setting.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-08 20:39:26 +00:00
Matthew Jordan 35b12af8b6 pjproject: Fix for Solaris builds. Do not undef s_addr.
pjproject, in order to solve build problems on Windows [1], undefines s_addr in
one of it's headers that is included in res_rtp_asterisk.c. On Solaris s_addr
is not a structure member, but defined to map to the real strucuture member,
therefore when building on Solaris it's possible to get build errors like:

    [CC] res_rtp_asterisk.c -> res_rtp_asterisk.o
    In file included from /export/home/admin/asterisk-11-svn/include/asterisk/stun.h:29,
                     from res_rtp_asterisk.c:51:
    /export/home/admin/asterisk-11-svn/include/asterisk/network.h: In function `inaddrcmp':
    /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr'
    /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr'
    res_rtp_asterisk.c: In function `ast_rtp_on_ice_tx_pkt':
    res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer will break strict-aliasing rules
    res_rtp_asterisk.c:710: warning: dereferencing type-punned pointer will break strict-aliasing rules
    res_rtp_asterisk.c: In function `rtp_add_candidates_to_ice':
    res_rtp_asterisk.c:1085: error: structure has no member named `s_addr'
    make[2]: *** [res_rtp_asterisk.o] Error 1
    make[1]: *** [res] Error 2
    make[1]: Leaving directory `/export/home/admin/asterisk-11-svn'
    gmake: *** [_cleantest_all] Error 2

Unfortunately, in order to make this work, I also had to make sure pjproject
only used the typdef pj_in_addr and not the struct pj_in_addr so that when
building Asterisk I could "typedef struct in_addr pj_in_addr". It's possible
then that the library and users of those interfaces in Asterisk have a different
idea about the type of the argument, while on the surface it looks like they are
all 32 bit big endian values.

[1] http://trac.pjsip.org/repos/changeset/484

(issues ASTERISK-20366)
Reported by: Ben Klang
Tested by: Ben Klang, mjordan
patches:
  0001-pjproject-Fix-for-Solaris-builds.-Do-not-undef-s.patch uploaded by Shaun Ruffell (license 5417)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-08 00:45:36 +00:00
Matthew Jordan bd36827e98 Handle capability stanzas that fail to provide node or version information
While XEP-0115 states that the node and ver attributes are both required, some
devices fail to provide either field.  Prior to this patch, failure to provide
the node or ver attribute would cause a crash in res_xmpp.  While failing to
provide the node or ver attribute is technically invalid, since this
information is not utilized by Asterisk except for reporting purposes, for
interoperability reasons, we continue to process the capability stanza anyways.

(closes issue ASTERISK-20495)
Reported by: Martin W
Tested by: Martin W
patches:
  20495.patch uploaded by Martin W (license #6434)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-06 03:22:37 +00:00
Matthew Jordan 15b35972ff Update documentation for MessageSend application/command's From field for XMPP
When using the channel technology agnostic application/AMI command MessageSend,
the "From" field is technically optional for the SIP channel driver.  However,
if being sent by the XMPP resource module (either res_xmpp or res_jabber), the
"From" field is necessary, and must correspond to a defined account.  This
patch updates the documentation for this application/AMI command to reflect
this.

(closes issue ASTERISK-20405)
Reported by: Leif Madsen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-06 01:47:00 +00:00
David M. Lee c5acf22cec Fix DBDelTree error codes for AMI, CLI and AGI
The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 15:48:24 +00:00
Matthew Jordan 481df22eac Check for presence of buddy in info/dinfo handlers
The res_jabber resource module uses the ASTOBJ library for managing its ref
counted objects.  After calling ASTOBJ_CONTAINER_FIND to locate a buddy object,
the pointer to the object has to be checked to see if the buddy existed.
Prior to this patch, the buddy object was not checked for NULL; with this patch
in both aji_client_info_handler and aji_dinfo_handler the pointer is checked
before used and, if no buddy object was found, the handlers return an error
code.

This patch does not take the approach that our JID can be used to log in from
another resource.  If that approach is desired, an improvement could be made to
this patch to create the buddy on the fly.  This patch seeks only to prevent
Asterisk from crashing.

FYI: In Asterisk 11+, you really should be using res_xmpp.  It does not have
this problem, as it moved to the astobj2 library.

Note that multiple people have proposed patches for this issue; the patch being
committed here is based on those.

(closes issue ASTERISK-19532)
Reported by: Karsten Wemheuer
Tested by: Byron Clark
patches:
  fix-jabber uploaded by Karsten Wemheuer (license #5930)
  xmpp_no_crash_with_ejabberd.patch uploaded by Byron Clark (license #6157)

(closes issue ASTERISK-19557)
Reported by: ulugutz
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 02:16:43 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Andrew Latham e11cc29360 Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

Breaking up commits to keep it easy to track

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:24:10 +00:00
Joshua Colp 0fc114dc65 Add support for retrieving engine specific settings using the speech API and from dialplan.
(closes issue ASTERISK-17136)
Reported by: kenner


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 12:29:04 +00:00
Richard Mudgett 1f9d7090df Include channel uniqueid in "AsyncAGI" and "AGIExec" events.
* Added AMI event documentation for AsyncAGI and AGIExec events.

(closes issue ASTERISK-20318)
Reported by: Dan Cropp
Patches:
      res_agi_patch.txt (license #6422) patch uploaded by Dan Cropp
      modified for trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 22:11:19 +00:00
Jonathan Rose 02d2280543 res_jabber: Remove CLI command 'jabber test'
The opinion of development was that it is both improper to have Matt's
personal email address used in the source and that the command wouldn't
be useful without it.

(closes issue AST-467)
Reported by: Malcolm Davenport
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 19:37:22 +00:00
Brent Eagles 89d427ca24 Reset hangup flags on channels created through messages and cleanup globals
in res_xmpp on unload.

This patch fixes an issue where hangup flags were not being reset on a
channel, affecting subsequent use of that channel. The patch also adds some
additional cleanup to res_xmpp to fix an issue with reloading the module.

(closes ASTERISK-20360)
Reported by: Noah Engelberth 
Tested by: beagles
Review: https://reviewboard.asterisk.org/r/2134/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 13:04:11 +00:00
Joshua Colp b6a00a1d97 Update documentation to make it explicit that "stream file" will not restart musiconhold.
(issue ASTERISK-17367)
Reported by: oej
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 12:17:41 +00:00
Joshua Colp 9f55e5e928 Make res_http_websocket an optional dependency on supported platforms for chan_sip.
(closes issue ASTERISK-20439)
Reported by: sruffell
Patches:
     0001-chan_sip-websocket-support-is-an-optional-API.patch uploaded by sruffell (license 5417)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-27 17:12:08 +00:00
Jonathan Rose 39b78f6250 res_agi: async_agi responsiveness improvement on datastore problems
This patch changes get_agi_cmd so that the return can be checked
to differentiate between an empty list success and something that
triggered an error. This in turn allows launch_asyncagi to detect
these errors and break free from the command processing loop so
that the async agi can be ended more cleanly

(closes issue ASTERISK-20109)
Reported by: Jeremiah Gowdy
Patches: jgowdy-7-9-2012.diff uploaded by Jeremiah Gowdy (license 6358)
           (Modified by me to fix some logical issues and apply to trunk)
Review: https://reviewboard.asterisk.org/r/2117/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 14:53:42 +00:00
Joshua Colp cdcbffeed0 Fix an issue where a caller to ast_write on a MulticastRTP channel would determine it failed when in reality it did not.
When sending RTP packets via multicast the amount of data sent is stored in a variable and returned
from the write function. This is incorrect as any non-zero value returned is considered a failure while
a return value of 0 is success. For callers (such as ast_streamfile) that checked the return value
they would have considered it a failure when in reality nothing went wrong and it was actually a success.

The write function for the multicast RTP engine now returns -1 on failure and 0 on success, as it should.

(closes issue ASTERISK-17254)
Reported by: wybecom
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 12:12:20 +00:00
Joshua Colp ad3e51bf4c Fix an issue with H.264 format attribute comparison and fix an issue with improper SDP being produced.
The H.264 format attribute module compares two format attribute structures to determine if they are
compatible or not. In some instances it was possible for this check to determine that both structures
were incompatible when they actually should be considered compatible. This check has now been made even
more permissive by assuming that if no attribute information is available the two structures are compatible.
If both structures contain attribute information a base level comparison of the H.264 IDC value is done to
see if they are compatible or not.

The above issue uncovered a secondary issue in chan_sip where the SDP being produced would be incorrect if
the formats were considered incompatible. This has now been fixed by checking that all information required
to produce the SDP is available instead of assuming it is.

(closes issue ASTERISK-20464)
Reported by: Leif Madsen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 14:27:17 +00:00
Brent Eagles f787f4219a res_rtp_asterisk: Make TURN and STUN server configurations consistent.
This patch removes the turnport configuration property and changes the
turnaddr property to be a combined host[:port] configuration string. The
patch also modifies the documentation in the example configuration to
reflect the property changes and adds some additional text indicating how
the STUN port is configured.

(closes issue ASTERISK-20344)
Reported by: beagles
Tested by: beagles
Review: https://reviewboard.asterisk.org/r/2111/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 12:42:19 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Joshua Colp e8380afc8a Add support for DTLS-SRTP to res_rtp_asterisk and chan_sip.
As mentioned on the review for this, WebRTC has moved towards choosing
DTLS-SRTP as the mechanism for key exchange for SRTP. This commit adds
support for this but makes it available for normal SIP clients as well.

Testing has been done to ensure that this introduces no regressions with
existing behavior and also that it functions as expected.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 18:27:28 +00:00
Sean Bright 7b823e9f8e When trying to unload res_curl.so, warn about all dependent modules.
Before this, attempting to unload res_curl.so would warn you about the first
module it found that was dependent.  We now warn about all of the loaded modules
instead.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 11:05:40 +00:00
Jonathan Rose 1e59e7ee08 res_xmpp: Fix a segfault caused by bodyless messages
(closes issue ASTERISK-20361)
Reported by: Noah Engelberth
Review: https://reviewboard.asterisk.org/r/2108/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-12 18:33:47 +00:00
Kinsey Moore d96b832787 Deprecate chan_gtalk, chan_jingle, and res_jabber
chan_gtalk, chan_jingle, and res_jabber are now deprecated in favor of
using chan_motif and res_xmpp. They are a feature-equivalent
replacement and are written to be more easily maintainable.

(closes issue ASTERISK-20298)
Review: https://reviewboard.asterisk.org/r/2082/
Reported-by: Leif Madsen
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 19:49:30 +00:00
David M. Lee 1f0f8694d8 res_rtp_asterisk: Eliminate "type-punned pointer" build warning.
Removes "res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer
will break strict-aliasing rules" warning from the build on 32-bit platforms.

The problem is that 'size' was referenced aliased to both (pj_size_t *) and
(pj_ssize_t *). Now just make a copy of size that is the right type so there
isn't any pointer aliasing happening.

It also adds comments and asserts regarding what looks like an inappropriate
use of pj_sock_sendto, but is actually totally fine.

(closes issue ASTERISK-20368)
Reported by: Shaun Ruffell
Tested by: Michael L. Young
Patches:
  0001-res_rtp_asterisk-Eliminate-type-punned-pointer-build.patch uploaded by Shaun Ruffell (license 5417)
    slightly modified by David M. Lee.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-10 19:22:54 +00:00
David M. Lee cab7acd21d Fix parallel make for res_asterisk_rtp.
Fixes a build regression introduced in r369517 "Add support for ICE/STUN/TURN
in res_rtp_asterisk and chan_sip." [1].

[1] http://svnview.digium.com/svn/asterisk?view=revision&revision=369517

When compiling asterisk in parallel like:
    $ make -j 10

It's possible to get errors like the following:

    .pjlib-util-test-x86_64-unknown-linux-gnu.depend:120: *** missing separator.  Stop.
    make[4]: *** [depend] Error 2
    make[3]: *** [dep] Error 1
    make[2]: *** [/home/sruffell/asterisk-working/res/pjproject/pjnath/lib/libpjnath-x86_64-unknown-linux-gnu.a] Error 2
    make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.

This is because the build system is trying to build each of the libraries in
pjproject in parallel. Now the build will build pjproject in a single job and
link the results into res_asterisk_rtp.

Parallel builds, on one test system, saves ~1.5 minutes from a default Asterisk
build:

Single job:
    $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make >/dev/null 2>&1 )

    real    2m34.529s
    user    1m41.810s
    sys     0m15.970s

Parallel make:
    $ git clean -fdx >/dev/null && time ( ./configure >/dev/null 2>&1 && make -j10 >/dev/null 2>&1 )

    real    1m2.353s
    user    2m39.120s
    sys     0m18.850s

(closes issue ASTERISK-20362)
Reported by: Shaun Ruffel
Patches:
    0001-res_asterisk_rtp-Fix-build-error-when-using-parallel.patch uploaded by Shaun Ruffel (License #5417)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07 20:53:48 +00:00
Richard Mudgett 6b2183244a Multiple revisions 372327-372328
........
  r372327 | rmudgett | 2012-09-05 12:33:11 -0500 (Wed, 05 Sep 2012) | 15 lines
  
  Fix RTP/RTCP read error message confusion.
  
  The RTP/RTCP read error message can report "fail: success" when the
  read failure is because of an ICE failure.
  
  * Changed __rtp_recvfrom() to generate a PJ ICE message when ICE fails.
  
  * Changed RTP/RTCP read error message to indicate an unspecified error
  when errno is zero.
  
  (closes issue ASTERISK-20288)
  Reported by: Joern Krebs
  Patches:
        jira_asterisk_20288_err_msg.patch (license #5621) patch uploaded by rmudgett (modified)
........
  r372328 | rmudgett | 2012-09-05 12:35:20 -0500 (Wed, 05 Sep 2012) | 1 line
  
  Fix coding guidelines issue with a recent commit.
........

Merged revisions 372327-372328 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 17:38:22 +00:00
Mark Michelson be500bbafb Re-fix sending unnegotiated payloads during a P2P RTP bridge.
The previous fix still would look in the static_RTP_PT table, which
is inappropriate since we specifically want to find a codec that has
been negotiated.

(closes issue ASTERISK-20296)
reported by NITESH BANSAL
Patches:
	codec_negotiation.patch Uploaded by NITESH BANSAL (License #6418)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 16:24:19 +00:00
Michael L. Young 35ac3b645e Fix breakage caused by last merge. Missing a variable for 11 and trunk.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 12:18:47 +00:00