asterisk/asterisk.git
7 years agoUpdate module support level on a variety of modules and compiler options
Matthew Jordan [Sat, 18 Aug 2012 01:14:42 +0000 (01:14 +0000)]
Update module support level on a variety of modules and compiler options

Some core support modules and compiler options were no longer tagged with a
module support level.  This patch adds 'core' back to those options.

Note that this patch modifies a few of the patches provided by Andrew Latham
slightly.  res_curl and res_fax are both 'core' supported modules.

(closes issue ASTERISK-20215)
Reported by: Andrew Latham
Tested by: mjordan
Patches:
  astcanary.diff (license #5985) uploaded by Andrew Latham
  cflagsxml.diff (license #5985) uploaded by Andrew Latham
  curl_fax.diff (license #5985) uploaded by Andrew Latham
  soundsxml.diff (license #5985) uploaded by Andrew Latham
........

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

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

7 years agoFix memory leak in XML documentation
Matthew Jordan [Fri, 17 Aug 2012 20:52:43 +0000 (20:52 +0000)]
Fix memory leak in XML documentation

When formatting documentation fields, the XML documentation parser calls
xmldoc_get_formatted.  This function allocates a string buffer at the
beginning of its routine.  Unfortunately, on certain code paths, it also
calls xmldoc_string_cleanup, which assumes that it will create the string
buffer.  The previously allocated string buffer is then leaked by the
xmldoc_string_cleanup routine.

Now: we don't do that.

(closes issue AST-932)
Reported by: Alexander Homig
........

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

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

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

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

7 years agoWhen a peer registers using WebSocket do not resolve the Contact provided.
Joshua Colp [Fri, 17 Aug 2012 19:50:58 +0000 (19:50 +0000)]
When a peer registers using WebSocket do not resolve the Contact provided.

(closes issue ASTERISK-20238)
Reported by: james.mortensen
........

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

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

7 years agoAdd instrumentation to subsystem reloads
Kinsey Moore [Fri, 17 Aug 2012 16:01:32 +0000 (16:01 +0000)]
Add instrumentation to subsystem reloads

When Asterisk is built with TEST_FRAMEWORK defined, Asterisk will now
generate TestEvent AMI events on subsystem reloads such as cdr, dnsmgr,
extconfig, etc.

(issue PQ-1126)
........

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

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

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

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

7 years agortp: Ensure defaults are set without rtp.conf.
Russell Bryant [Fri, 17 Aug 2012 12:42:33 +0000 (12:42 +0000)]
rtp: Ensure defaults are set without rtp.conf.

While building up a new install to test chan_motif, I ran into a failure
due to icesupport being disabled.  This was due to me not having an
rtp.conf.  It was intended in the code for it to be enabled by default,
but it was only applied if rtp.conf existed.

This patch updates res_rtp_asterisk to be consistent in how it handles
defaults.  A few options didn't have their default values set globally,
including icesupport.  They are now set and icesupport is enabled by
default, even if you do not have an rtp.conf.
........

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

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

7 years agoAdd some additional H.264 attributes, "max-smbps" and "max-fps", for passthrough.
Joshua Colp [Fri, 17 Aug 2012 12:25:40 +0000 (12:25 +0000)]
Add some additional H.264 attributes, "max-smbps" and "max-fps", for passthrough.

(closes issue ASTERISK-20206)
Reported by: ddkprog
Patches:
     res_format_attr_h264.c.diff uploaded by ddkprog (license 6008)
........

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

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

7 years agoHandle integer over/under-flow in ast_parse_args
Terry Wilson [Thu, 16 Aug 2012 23:08:40 +0000 (23:08 +0000)]
Handle integer over/under-flow in ast_parse_args

The strtol family of functions will return *_MIN/*_MAX on overflow. To
detect when an overflow has happened, errno must be set to 0 before
calling the function, then checked afterward.

(closes issue ASTERISK-20120)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2073/
........

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

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

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

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

7 years agoAdd module reload instrumentation for TEST_FRAMEWORK
Kinsey Moore [Thu, 16 Aug 2012 22:45:33 +0000 (22:45 +0000)]
Add module reload instrumentation for TEST_FRAMEWORK

This adds AMI events for module reloads when Asterisk is built with
TEST_FRAMEWORK enabled and corrects generation of the module load AMI
event.

(issue PQ-1126)
........

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

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

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

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

7 years agochan_sip: Use pvt outgoing_call variable to set Remote-Party-ID Header
Jonathan Rose [Thu, 16 Aug 2012 19:52:08 +0000 (19:52 +0000)]
chan_sip: Use pvt outgoing_call variable to set Remote-Party-ID Header

Previously the pvt SIP_OUTGOING flag was used instead, which will frequently
flip during reinvites.

(closes issue AST-897)
Reported by: Thomas Arimont
........

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

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

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

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

7 years agochan_sip: Trigger reinvite if the SDP answer is included in the SIP ACK
Jonathan Rose [Thu, 16 Aug 2012 18:28:30 +0000 (18:28 +0000)]
chan_sip: Trigger reinvite if the SDP answer is included in the SIP ACK

Under certain conditions, a SIP transaction involving directmedia wouldn't
trigger a re-invite because the SDP answer was included in an ACK instead
of in a message that we would have triggered the invite with. This patch
just queues a source change control frame if the dialog is using
directmedia when we find sdp for an ACK.

(closes issue AST-913)
Reported by: Thomas Arimont
........

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

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

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

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

7 years agoFix bug where final queue member would not be removed from memory.
Mark Michelson [Wed, 15 Aug 2012 23:35:35 +0000 (23:35 +0000)]
Fix bug where final queue member would not be removed from memory.

If a static queue had realtime members, then there could be a potential
for those realtime members not to be properly deleted from memory.

If the queue's members were loaded from realtime and then all the
members were deleted from the backend, then the queue would still
think these members existed. The reason was that there was a short-
circuit in code such that if there were no members found in the
backend, then the queue would not be updated to reflect this.

Note that this only affected static queues with realtime members.
Realtime queues with realtime members were unaffected by this issue.

(closes issue ASTERISK-19793)
reported by Marcus Haas
........

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

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

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

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

7 years agoFix Segfault When Registering SIP Over WebSockets
Michael L. Young [Wed, 15 Aug 2012 20:43:37 +0000 (20:43 +0000)]
Fix Segfault When Registering SIP Over WebSockets

The helper function, get_address_family_filter, in chan_sip for dns resolution
by address family was not recognizing the websockets transport and resulting in
a null pointer being sent to functions in netsock2, in an attempt to determine
if we are bound to ANY address ([::]) or not.

This patch fixes this issue by handling the transport types SIP_TRANSPORT_WS and
SIP_TRANSPORT_WSS which results in a sock address being set properly for use in
determining the address family.

(closes issue ASTERISK-20221)
Reported by: Sven Beisiegel
Tested by: Sven Beisiegel, James Mortensen
Patches:
asterisk-20221-ws-family-filter.diff uploaded by Michael L. Young (license 5026)
........

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

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

7 years agoAvoid unconditional NULLing of mwipvt on relatedpeer on SIP dialog destruction
Kinsey Moore [Wed, 15 Aug 2012 20:18:26 +0000 (20:18 +0000)]
Avoid unconditional NULLing of mwipvt on relatedpeer on SIP dialog destruction

The other instance of this bug was fixed by jcolp/file in r121496. If
we are destroying a dialog only set the MWI dialog pointer on the
related peer to NULL if it is the dialog currently being destroyed.

(closes issue ASTERISK-20119)
Patch-by: Misha Vodsedalek
........

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

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

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

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

7 years agoAdd HANGUPCAUSE information to callee channels
Kinsey Moore [Wed, 15 Aug 2012 17:56:04 +0000 (17:56 +0000)]
Add HANGUPCAUSE information to callee channels

This adds HANGUPCAUSE information to called channels so that hangup
handlers can, in conjunction with predial dialplan execution, access
the hangupcause information when the dialed channel hangs up on a
one-to-one basis instead of a many-to-one basis as with HANGUPCAUSE
usage on the caller channel.

Review: https://reviewboard.asterisk.org/r/2069/
(closes issue ASTERISK-20198)
........

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

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

7 years agoAdd test instrumentation
Kinsey Moore [Mon, 13 Aug 2012 20:36:51 +0000 (20:36 +0000)]
Add test instrumentation

This adds test instrumentation for loading and unloading of modules
and for certain actions in MeetMe to be used in the testsuite or any
other consumer of AMI events.  These will only be generated when
Asterisk is built with TEST_FRAMEWORK enabled.

(issue PQ-1131)
(issue PQ-1133)
........

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

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

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

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

7 years agoFix problem where incorrect pointer was checked for nullity.
Mark Michelson [Mon, 13 Aug 2012 20:02:41 +0000 (20:02 +0000)]
Fix problem where incorrect pointer was checked for nullity.
........

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

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

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

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

7 years agoAdd UPGRADE-11.txt file; update UPGRADE.txt to reflect Asterisk 12
Matthew Jordan [Sat, 11 Aug 2012 19:13:55 +0000 (19:13 +0000)]
Add UPGRADE-11.txt file; update UPGRADE.txt to reflect Asterisk 12

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

7 years agoUpdate CHANGES for private party ID.
Richard Mudgett [Fri, 10 Aug 2012 22:04:32 +0000 (22:04 +0000)]
Update CHANGES for private party ID.
........

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

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

7 years agoFix a couple of documentation problems in app_queue.c
Mark Michelson [Fri, 10 Aug 2012 21:35:18 +0000 (21:35 +0000)]
Fix a couple of documentation problems in app_queue.c

* The RemoveQueueMember app made mention of options that could
be passed in, but no options are supported. I have removed the
listing of options from the documentation.

* The RQMSTATUS variable did not list "NOTDYNAMIC" as a possible
value that could be set.

(closes issue AST-949)
reported by Steve Pitts

(closes issue AST-954)
reported by Steve Pitts
........

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

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

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

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

7 years agoRemove 10 properties, add 11 properties
Matthew Jordan [Fri, 10 Aug 2012 21:09:47 +0000 (21:09 +0000)]
Remove 10 properties, add 11 properties

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

7 years agoAdd private representation of caller, connected and redirecting party ids.
Richard Mudgett [Fri, 10 Aug 2012 19:54:55 +0000 (19:54 +0000)]
Add private representation of caller, connected and redirecting party ids.

This patch adds the feature "Private representation of caller, connected
and redirecting party ids", as previously discussed with us (DATUS) and
Digium.

1. Feature motivation

Until now it is quite difficult to modify a party number or name which can
only be seen by exactly one particular instantiated technology channel
subscriber.  One example where a modified party number or name on one
channel is spread over several channels are supplementary services like
call transfer or pickup.  To implement these features Asterisk internally
copies caller and connected ids from one channel to another.  Another
example are extension subscriptions.  The monitoring entities (watchers)
are notified of state changes and - if desired - of party numbers or names
which represent the involving call parties.  One major feature where a
private representation of party names is essentially needed, i.e.  where a
party name shall be exclusively signaled to only one particular user, is a
private user-specific name resolution for party numbers.  A lookup in a
private destination-dependent telephone book shall provide party names
which cannot be seen by any other user at any time.

2. Feature Description

This feature comes along with the implementation of additional private
party id elements for caller id, connected id and redirecting ids inside
Asterisk channels.

The private party id elements can be read or set by the user using
Asterisk dialplan functions.

When a technology channel is initiating a call, receives an internal
connected-line update event, or receives an internal redirecting update
event, it merges the corresponding public id with the private id to create
an effective party id.  The effective party id is then used for protocol
signaling.

The channel technologies which initially support the private id
representation with this patch are SIP (chan_sip), mISDN (chan_misdn) and
PRI (chan_dahdi).

Once a private name or number on a channel is set and (implicitly) made
valid, it is generally used for any further protocol signaling until it is
rewritten or invalidated.

To simplify the invalidation of private ids all internally generated
connected/redirecting update events and also all connected/redirecting
update events which are generated by technology channels -- receiving
regarding protocol information - automatically trigger the invalidation of
private ids.

If not using the private party id representation feature at all, i.e.  if
using only the 'regular' caller-id, connected and redirecting related
functions, the current characteristic of Asterisk is not affected by the
new extended functionality.

3. User interface Description

To grant access to the private name and number representation from the
Asterisk dialplan, the CALLERID, CONNECTEDLINE and REDIRECTING dialplan
functions are extended by the following data types.  The formats of these
data types are equal to the corresponding regular 'non-private' already
existing data types:

CALLERID:
priv-all
priv-name priv-name-valid priv-name-charset priv-name-pres
priv-num priv-num-valid priv-num-plan priv-num-pres
priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd
priv-tag

CONNECTEDLINE:
priv-name priv-name-valid priv-name-pres priv-name-charset
priv-num priv-num-valid priv-num-pres priv-num-plan
priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd
priv-tag

REDIRECTING:
priv-orig-name priv-orig-name-valid priv-orig-name-pres priv-orig-name-charset
priv-orig-num priv-orig-num-valid priv-orig-num-pres priv-orig-num-plan
priv-orig-subaddr priv-orig-subaddr-valid priv-orig-subaddr-type priv-orig-subaddr-odd
priv-orig-tag

priv-from-name priv-from-name-valid priv-from-name-pres priv-from-name-charset
priv-from-num priv-from-num-valid priv-from-num-pres priv-from-num-plan
priv-from-subaddr priv-from-subaddr-valid priv-from-subaddr-type priv-from-subaddr-odd
priv-from-tag

priv-to-name priv-to-name-valid priv-to-name-pres priv-to-name-charset
priv-to-num priv-to-num-valid priv-to-num-pres priv-to-num-plan
priv-to-subaddr priv-to-subaddr-valid priv-to-subaddr-type priv-to-subaddr-odd
priv-to-tag

Reported by: Thomas Arimont

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

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

7 years agoFix a comparison that was causing presence tests to fail.
Mark Michelson [Fri, 10 Aug 2012 17:56:05 +0000 (17:56 +0000)]
Fix a comparison that was causing presence tests to fail.

A recent change made it so that device state changes that were
not actual "changes" would not get reported to subscribers. The
problem was that this inadvertently blocked presence updates as
well.

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

7 years agoremove ALREADYGONE flag on ooh323 call data by ooh323_indicate
Alexandr Anikin [Fri, 10 Aug 2012 16:49:27 +0000 (16:49 +0000)]
remove ALREADYGONE flag on ooh323 call data by ooh323_indicate
(CONGESTION/BUSY) due to call hasn't gone there really.
This indication arrive from asterisk core not h.323 stack

(closes issue ASTERISK-19308)
Reported by: Dmitry Melekhov
Patches:
        ASTERISK-19308.patch
........

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

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

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

7 years agoSend re-register packets by GRQ (gatekeeper request) interval
Alexandr Anikin [Fri, 10 Aug 2012 15:24:03 +0000 (15:24 +0000)]
Send re-register packets by GRQ (gatekeeper request) interval

(close issue ASTERISK-20094)

Patches:
   ASTERISK-20094-2.patch
........

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

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

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

7 years agorestore calling cb functions by timer expire
Alexandr Anikin [Fri, 10 Aug 2012 14:45:33 +0000 (14:45 +0000)]
restore calling cb functions by timer expire
this was broken in rev 369602

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

7 years agoFix pickup extension channel reference error.
Richard Mudgett [Fri, 10 Aug 2012 02:07:55 +0000 (02:07 +0000)]
Fix pickup extension channel reference error.

You cannot unref a pointer and then expect to ref it again later.

* Fix potential NULL pointer deref if the call pickup search fails.

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

7 years agoIntrodue 'ooh323 show gk' cli command that show status of connection
Alexandr Anikin [Thu, 9 Aug 2012 21:35:24 +0000 (21:35 +0000)]
Introdue 'ooh323 show gk' cli command that show status of connection
to H.323 Gatekeeper (GkClient state)

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

7 years agoFix to resend GRQ/RRQ if RRJ (registration reject) is received
Alexandr Anikin [Thu, 9 Aug 2012 19:33:41 +0000 (19:33 +0000)]
Fix to resend GRQ/RRQ if RRJ (registration reject) is received

(close issue ASTERISK-20094)

Patches:
   ASTERISK-20094.patch
........

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

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

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

7 years agoUse better libss7 detection test and move libpri compile test.
Richard Mudgett [Thu, 9 Aug 2012 19:22:35 +0000 (19:22 +0000)]
Use better libss7 detection test and move libpri compile test.
........

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

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

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

7 years agochange opening h323 logfile with append mode instead of overwrite
Alexandr Anikin [Thu, 9 Aug 2012 18:28:15 +0000 (18:28 +0000)]
change opening h323 logfile with append mode instead of overwrite
........

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

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

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

7 years agoCorrect documentation for the MeetMe x flag
Kinsey Moore [Thu, 9 Aug 2012 17:40:45 +0000 (17:40 +0000)]
Correct documentation for the MeetMe x flag

The documentation for the x flag for MeetMe incorrectly described its
function as closing down the conference when the last marked user left.
It actually causes the users with that flag to leave the conference
when the last marked user exits. The functionality of this flag is not
changing.
........

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

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

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

7 years agoExtend extension state callbacks to have more information.
Mark Michelson [Thu, 9 Aug 2012 14:52:16 +0000 (14:52 +0000)]
Extend extension state callbacks to have more information.

Quote from review board:

This patch extends the extension state callbacks so that monitoring channels
(as chan_sip) get more information of the devices which are responsible for
an extension state change. The additional information is needed by chan_sip
to present names/numbers of the caller and callee in an early-state SIP
notification. Users of extenstion state callback not interested in the
additional information are not affected by the changes.

Motivation: to present the involved party's name/number in an early-state
nofification (used by the notified device as a pickup offer) one after another
so that a user can see which call he will pick up in an undirected pickup.
Such a pickup offer to a user shall indicate the same call (number/name-A calls
number/name-B) as the call which would be picked up when an undirected pickup
is executed.

Users interested in additional state info must use the new functions
ast_extension_state_add_extended() resp.
ast_extension_state_add_destroy_extended() to register an extended state
callback. When the callback is registered this way, an extra member
device_state_info of struct ast_state_cb_info is passed to the callback in
addition to the aggregated extension state. This container holds an object for
every device of the monitored extension hint consisting of the device name, the
device state and a channel reference to the channel which (presumably) caused
the device state.

The information is used by chan_sip for early-state notifications. When the
state of a device changes and the new state contains AST_EVENT_RINGING, an
early-state notification is sent to the subscribed devices with the
caller/callee names/numbers of the oldest ringing channel of the monitored
extension. The notified user may then invoke a direct pickup, which will pickup
exactly this channel.

Users of the old non-extended callbacks will only be called when the aggregated
state did change (same behavior as before). Users of the extended callback will
also be called when the state is unchanged but does contain AST_EVENT_RINGING.
That could be the case if two channels are ringing at one device and one of
them hangs up, so the aggregated state does not change. This way the monitoring
channel can create a new early-state notification with the now ringing
party-ids.

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

This contribution comes from Guenther Kelleter

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

7 years agoDUNDi: Add CLI commands DUNDi show cache and DUNDi show hints
Jonathan Rose [Thu, 9 Aug 2012 14:36:37 +0000 (14:36 +0000)]
DUNDi: Add CLI commands DUNDi show cache and DUNDi show hints

(closes issue ASTERISK-18390)
Reported by: Peter Racz
Patches:
dundi_cli_cache.patch.v2 uploaded by Peter Racz (license #6290)
ASTERISK-18390_dundi_cli_cache_jrose_mods_v2.diff uploaded by Jonathan Rose (license #6182)

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

7 years agoFix Not Unreferencing A Spied Channel
Michael L. Young [Wed, 8 Aug 2012 22:45:15 +0000 (22:45 +0000)]
Fix Not Unreferencing A Spied Channel

When a channel hangs up while being spied upon and the option to exit the
ChanSpy application when the spied on channel hangs up is set,
ast_autochan_destroy is not being called and therefore a reference to the spied
upon channel is not removed.

The symptom being reported was that when using func_group in the dialplan and
calling "group show channels" at the cli, the spied upon channel was still
being shown while "core show channels" showed that the channel was not up.

This patch calls ast_autochan_destroy when a spied upon channel hangs up and
the option to exit the ChanSpy application is set, removing the reference to
the channel allowing the count for the group that the spied channel was part of
to be decremented.

(closes issue ASTERISK-17515)
Reported by: Arkadiusz Malka
Tested by: Alexandr Gordeev, Michael L. Young
Patches:
    asterisk-17515-destroy-autochan.diff
                                    uploaded by Michael L. Young (license 5026)
........

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

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

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

7 years agoMove a SIP change up to the other SIP changes in the CHANGES file.
Mark Michelson [Wed, 8 Aug 2012 22:41:08 +0000 (22:41 +0000)]
Move a SIP change up to the other SIP changes in the CHANGES file.

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

7 years agoAllow support for early media on AMI originates and call files.
Mark Michelson [Wed, 8 Aug 2012 22:39:40 +0000 (22:39 +0000)]
Allow support for early media on AMI originates and call files.

This is based on the work done by Olle Johansson on review board.

The idea is that the channel specified in an AMI originate or call
file is typically not connected to the outgoing extension until the
channel has been answered. With this change, an EarlyMedia header can
be specified for AMI originates and an early_media option can
be specified in call files. With this option set, once early media is
received on a channel, it will be connected with the outgoing extension.

(closes issue ASTERISK-18644)
Reported by Olle Johansson

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

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

7 years agoAdd AMI_CLIENT dialplan function
Terry Wilson [Wed, 8 Aug 2012 21:22:08 +0000 (21:22 +0000)]
Add AMI_CLIENT dialplan function

Implementation of a dialplan function for checking manager accounts. Right now
it only returns the number of logged in sessions for a manager account, but
other attributes can be added later.

Patch by: Olle Johansson
Review: https://reviewboard.asterisk.org/r/421/

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

7 years agoCreate the payload type if it does not exist when setting information based on the...
Joshua Colp [Wed, 8 Aug 2012 20:47:29 +0000 (20:47 +0000)]
Create the payload type if it does not exist when setting information based on the 'm' line. An rtpmap attribute is not required for defined payload numbers.

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

7 years agoConvert sig_analog to use a global callback table.
Richard Mudgett [Wed, 8 Aug 2012 20:32:53 +0000 (20:32 +0000)]
Convert sig_analog to use a global callback table.

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

7 years agoDo not define a cause that doesn't actually exist
Kinsey Moore [Wed, 8 Aug 2012 20:30:52 +0000 (20:30 +0000)]
Do not define a cause that doesn't actually exist

AST_CAUSE_NOTDEFINED is a placeholder for usage when there is no cause
information. As such, it should not be defined and translatable as a
cause.
........

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

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

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

7 years agoFix the analog dial *0 flash-hook of bridged peer feature.
Richard Mudgett [Wed, 8 Aug 2012 20:17:02 +0000 (20:17 +0000)]
Fix the analog dial *0 flash-hook of bridged peer feature.

The flash-hook the bridged peer feature now correctly determines if the
bridged peer is another chan_dahdi channel, that it is an analog channel,
and that it has the correct signaling for an FXO port.  It now also
flash-hooks the correct channel.
........

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

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

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

7 years agoConvert sig_pri to use a global callback table.
Richard Mudgett [Wed, 8 Aug 2012 00:35:37 +0000 (00:35 +0000)]
Convert sig_pri to use a global callback table.

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

7 years agoConvert sig_ss7 to use a global callback table.
Richard Mudgett [Wed, 8 Aug 2012 00:15:54 +0000 (00:15 +0000)]
Convert sig_ss7 to use a global callback table.

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

7 years agoRewrite of skinny debugging.
Damien Wedhorn [Tue, 7 Aug 2012 21:58:01 +0000 (21:58 +0000)]
Rewrite of skinny debugging.

Debugging messages and associated controls only compiled in if configured with --enable-dev-mode. Debug messages provide more detail (including thread id) and are grouped so the user/dev can limit the type of messages displayed. Functionally no real change to chan_skinny.

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

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

7 years agoPayload and RTP code are must remain separate since in non-Asterisk format cases...
Joshua Colp [Tue, 7 Aug 2012 19:59:51 +0000 (19:59 +0000)]
Payload and RTP code are must remain separate since in non-Asterisk format cases they differ.

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

7 years agoRecorded merge of revisions 370858 from http://svn.asterisk.org/svn/asterisk/branches/10
Kinsey Moore [Tue, 7 Aug 2012 19:26:21 +0000 (19:26 +0000)]
Recorded merge of revisions 370858 from svn.asterisk.org/svn/asterisk/branches/10

........
Add missing AST_CAUSE_* -> text translations
........

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

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

7 years agoAdd missing AST_CAUSE_* -> text translations
Kinsey Moore [Tue, 7 Aug 2012 18:21:56 +0000 (18:21 +0000)]
Add missing AST_CAUSE_* -> text translations

A few of these were missing from the list and are necessary for the Who
Hung Up? functionality.

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

7 years agoFix a bug uncovered by the test suite where the RTP payload number was not getting...
Joshua Colp [Tue, 7 Aug 2012 17:47:52 +0000 (17:47 +0000)]
Fix a bug uncovered by the test suite where the RTP payload number was not getting set.

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

7 years agoReduce memory consumption significantly for users of the RTP engine API by storing...
Joshua Colp [Tue, 7 Aug 2012 13:07:58 +0000 (13:07 +0000)]
Reduce memory consumption significantly for users of the RTP engine API by storing only the payloads present and in use instead of every possible one.

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

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

7 years agoAdd named callgroups/pickupgroups
Matthew Jordan [Tue, 7 Aug 2012 12:46:36 +0000 (12:46 +0000)]
Add named callgroups/pickupgroups

This patch adds named calledgroups/pickupgroups to Asterisk.  Named groups are
implemented in parallel to the existing numbered callgroup/pickupgroup
implementation.  However, unlike the existing implementation, which is limited
to a maximum of 64 defined groups, the number of defined groups allowed for
named callgroups/pickupgroups is effectively unlimited.

Named groups are configured with the keywords "namedcallgroup" and
"namedpickupgroup".  This corresponds to the numbered group definitions of
"callgroup" and "pickupgroup".  Note that as the implementation of named groups
coexists with the existing numbered implementation, a defined named group of
"4" does not equate to numbered group 4.

Support for the named groups has been added to the SIP, DAHDI, and mISDN channel
drivers.

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

Uploaded by:
Guenther Kelleter(license #6372)

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

7 years agoRevert r370820
Matthew Jordan [Mon, 6 Aug 2012 17:04:40 +0000 (17:04 +0000)]
Revert r370820

That change is wrong, wrong, wrong.

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

7 years agoUpdate the MySQL voicemail_data contrib script to reflect Asterisk 11 changes
Matthew Jordan [Mon, 6 Aug 2012 17:00:28 +0000 (17:00 +0000)]
Update the MySQL voicemail_data contrib script to reflect Asterisk 11 changes

All voicemails now have a 'msg_id' included in their metadata.  The ODBC
message storage backend now requires this column; as such, the MySQL contrib
script that creates the voicemail_data table has been updated with the appropriate
column information.

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

7 years agoImprove debug message for temporary outbound proxies.
Mark Michelson [Mon, 6 Aug 2012 15:18:18 +0000 (15:18 +0000)]
Improve debug message for temporary outbound proxies.

Thanks to Paul Belanger for pointing this out.
........

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

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

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

7 years agoMultiple revisions 370769-370771
Mark Michelson [Fri, 3 Aug 2012 21:52:57 +0000 (21:52 +0000)]
Multiple revisions 370769-370771

........
  r370769 | mmichelson | 2012-08-03 16:35:00 -0500 (Fri, 03 Aug 2012) | 24 lines

  Fix error in the "IPorHost" section of a SIP dialstring.

  This is based on the review request posted by Walter Doekes
  (referenced lower in the commit message)

  The main fix here is to treat the IPorHost portion of the dial
  string as a temporary outbound proxy. This ensures requests
  get sent to the proper location.

  Due to the age of the request, some parts were no longer relevant.
  For instance, the request moved outbound proxy parsing code into
  a single method. This is done in a previous commit, so it was not
  necessary to do again.

  Also, the review request fixed some errors with regards to request
  routing for CANCEL and ACK requests. This has also been fixed in
  more recent commits.

  (closes issue ASTERISK-19677)
  reported by Walter Doekes

  Review https://reviewboard.asterisk.org/r/1859
........
  r370770 | mmichelson | 2012-08-03 16:39:35 -0500 (Fri, 03 Aug 2012) | 3 lines

  Remove unused variable.
........
  r370771 | mmichelson | 2012-08-03 16:43:52 -0500 (Fri, 03 Aug 2012) | 5 lines

  Seriously? Another compilation error fixed.

  Somebody beat me.
........

Merged revisions 370769-370771 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

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

7 years agoFix regression from r370636
Kinsey Moore [Thu, 2 Aug 2012 15:51:17 +0000 (15:51 +0000)]
Fix regression from r370636

When the chan_sip cleanup went in, a typo was included that caused some
subscriptions of non-Polycom phones to be limited to the same
capabilities as Polycom phones. This resolves the failures in the test
suite resulting from this regression.

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

7 years agoFix a possible crash due to passing NULL to ast_variables_dup()
Mark Michelson [Wed, 1 Aug 2012 19:37:03 +0000 (19:37 +0000)]
Fix a possible crash due to passing NULL to ast_variables_dup()

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

7 years agoMake astobj2.h not include linkedlists.h.
Richard Mudgett [Wed, 1 Aug 2012 18:52:29 +0000 (18:52 +0000)]
Make astobj2.h not include linkedlists.h.

Using astobj2 does not require linkedlists.h be included even though
astob2 uses linked lists internally.

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

7 years agoRevert alloca changes for utils
Kinsey Moore [Wed, 1 Aug 2012 02:26:53 +0000 (02:26 +0000)]
Revert alloca changes for utils

These changes were a tad overzealous in the utils directory.
Unfortunately, these don't compile with a "make".
........

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

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

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

7 years agoAdd headers from SIPAddHeader to outbound REFER requests.
Mark Michelson [Tue, 31 Jul 2012 22:28:16 +0000 (22:28 +0000)]
Add headers from SIPAddHeader to outbound REFER requests.

This is a patch from kkm from review board.

This is useful for adding headers to REFER requests that
emanate from a Transfer() dialplan application call.

This also fixes some uses of the Referred-by header, removing
an extra set of angle brackets.

I've modified the reporter's original patch to not require
any additions to the sip_refer header and to just remove the
referred_by_name from sip_refer since it is no longer needed
or used.

(closes Issue ASTERISK-17639)
reported by Kirill Katsnelson
Patches:
019059-sip-refer-addheaders-trunk-353549.diff
uploaded by Kirill Katsnelson (license #5845)

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

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

7 years agoAdd "setvar" option to manager.conf.
Mark Michelson [Tue, 31 Jul 2012 21:21:57 +0000 (21:21 +0000)]
Add "setvar" option to manager.conf.

With this option set, channel variables can be set on
every manager originate. The Variable header can still
be used to set additional channel variables for individual
calls if desired.

This work was completed by Olle Johansson on review board.
I have applied the review feedback and am committing it in
order to get this into trunk before Asterisk 11 is branched.

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

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

7 years agoSchedule pokes of registered SIP peers within a given timespan after SIP reload
Matthew Jordan [Tue, 31 Jul 2012 21:20:59 +0000 (21:20 +0000)]
Schedule pokes of registered SIP peers within a given timespan after SIP reload

With a large number of SIP peers registered, performing a SIP reload causes a
flood of SIP OPTIONS request packets.  These are immediately sent out, and, as
responses come back, can cause peers to be flagged as 'lagged' due to handling
of the many response messages.

This fix prevents this "packet storm" and schedules the pokes for a random
time.  That time varies between 1 ms and the peer's qualify time, or, if
the qualify time is unknown, the global qualifyfreq setting.

The committed patch has some very small modifications to the patch schmidts
wrote for the review.

(closes issue ASTERISK-19154)
Reported by: Nicolo Mazzon
patches:
  issue19154.patch license #6034 uploaded by schmidts

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

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

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

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

7 years agoMove event cache updates into event processing thread.
Russell Bryant [Tue, 31 Jul 2012 20:33:57 +0000 (20:33 +0000)]
Move event cache updates into event processing thread.

Prior to this patch, updating the device state cache was done by the thread
that originated the event.  It would update the cache and then queue the event
up for another thread to dispatch.  This thread moves the cache updating part
to be in the same thread as event dispatching.

I was working with someone on a heavily loaded Asterisk system and while
reviewing backtraces of the system while it was having problems, I noticed that
there were a lot of threads contending for the lock on the event cache.  By
simply moving this into a single thread, this helped performance *a lot* and
alleviated some deadlock-like symptoms.

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

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

7 years agoClean up and ensure proper usage of alloca()
Kinsey Moore [Tue, 31 Jul 2012 20:21:43 +0000 (20:21 +0000)]
Clean up and ensure proper usage of alloca()

This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

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

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

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

7 years agoAdd "dialplan remove context" and modify "dialplan add include"
Mark Michelson [Tue, 31 Jul 2012 19:57:21 +0000 (19:57 +0000)]
Add "dialplan remove context" and modify "dialplan add include"

From corruptor's review board posting:

"I've noticed that we can remove particular extension from context with
dialplan remove extension command but in order to remove all extensions
in the context we should delete them on by one. I've created dialplan
remove context command which uses ast_context_destroy to destroy the
whole context with all extensions. I've created to functions for in
pbx_config.c: handle_cli_dialplan_remove_context which actually removes
context and complete_dialplan_remove_context which completes input.
They are based on other similar functions and pretty trivial but I can be
mistaken somewhere.

"I've also modified dialplan add include <context2> into <context1>. I've
made it similar dialplan add extension ... command. It creates <context1>
if it doesn't exist and I've also modified complete_dialplan_add_include
and removed check for existance of <context2> because we can include
non-existent context into another one. (I usually include empty
(non-existent) contexts in advance). Should we raise warning in this case
as it's raised while reading extensions.conf?

"I use those functions with AMI. I think manager commands should be created
in addition to those CLI commands."

I've addressed the latest comments on review board and have made some other
coding guidelines-related cleanup. I also have modified the CHANGES file to
mention these new commands.

(closes issue ASTERISK-19292)
reported by Andrey Solovyev

Patches:
dialplan_add_include.patch
    uploaded by Andrey Solovyev (license #5214)
    dialplan_remove_context.patch
    uploaded by Andrey Solovyev (license #5214)

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

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

7 years agoClean up chan_sip
Kinsey Moore [Tue, 31 Jul 2012 19:10:41 +0000 (19:10 +0000)]
Clean up chan_sip

This clean up was broken out from
https://reviewboard.asterisk.org/r/1976/ and addresses the following:
 - struct sip_refer converted to use the stringfields API.
 - sip_{refer|notify}_allocate -> sip_{notify|refer}_alloc to match
   other *alloc functions.
 - Replace get_msg_text, get_msg_text2 and get_pidf_body -> No, not
   get_pidf_msg_text_body3 but get_content, to match add_content.
 - get_body doesn't get the request body, renamed to get_content_line.
 - get_body_by_line doesn't get the body line, and is just a simple if
   test. Moved code inline and removed function.
 - Remove camelCase in struct sip_peer peer state variables,
   onHold -> onhold, inUse -> inuse, inRinging -> ringing.
 - Remove camelCase in struct sip_request rlPart1 -> rlpart1,
   rlPart2 -> rlpart2.
 - Rename instances of pvt->randdata to pvt->nonce because that is what
   it is, no need to update struct sip_pvt because _it already has a
   nonce field_.
 - Removed struct sip_pvt randdata stringfield.
 - Remove useless (and inconsistent) 'header' suffix on variables in
   handle_request_subscribe.
 - Use ast_strdupa on Event header in handle_request_subscribe to avoid
   overly complicated strncmp calls to find the event package.
 - Move get_destination check in handle_request_subscribe to avoid
   duplicate checking for packages that don't need it.
 - Move extension state callback management in handle_request_subscribe
   to avoid duplicate checking for packages that don't need it.
 - Remove duplicate append_date prototype.
 - Rename append_date -> add_date to match other add_xxx functions.
 - Added add_expires helper function, removed code that manually added
   expires header.
 - Remove _header suffix on add_diversion_header (no other header adding
   functions have this).
 - Don't pass req->debug to request handle_request_XXXXX handlers if req
   is also being passed.
 - Don't pass req->ignore to check_auth as req is already being passed.
 - Don't create a subscription in handle_request_subscribe if
   p->expiry == 0.
 - Don't walk of the back of referred_by_name when splitting string in
   get_refer_info
 - Remove duplicate check for no dialog in handle_incoming when
   sipmethod == SIP_REFER, handle_request_refer checks for that.

Review: https://reviewboard.asterisk.org/r/1993/
Patch-by: gareth

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

7 years agoTweak unit test warning message.
Richard Mudgett [Mon, 30 Jul 2012 23:26:51 +0000 (23:26 +0000)]
Tweak unit test warning message.

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

7 years agoFix some presence-state unit test typos.
Richard Mudgett [Mon, 30 Jul 2012 23:18:13 +0000 (23:18 +0000)]
Fix some presence-state unit test typos.

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

7 years agoDECLINE to load confbridge if the config fails to load.
Richard Mudgett [Mon, 30 Jul 2012 20:27:39 +0000 (20:27 +0000)]
DECLINE to load confbridge if the config fails to load.

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

7 years agoRelease B channel allocation on error path in chan_misdn.
Richard Mudgett [Mon, 30 Jul 2012 16:57:41 +0000 (16:57 +0000)]
Release B channel allocation on error path in chan_misdn.
........

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

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

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

7 years agoapp_meetme: Change app_meetme support level to extended from deprecated
Jonathan Rose [Mon, 30 Jul 2012 14:52:02 +0000 (14:52 +0000)]
app_meetme: Change app_meetme support level to extended from deprecated

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

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

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

7 years agoFix ast_event_new unit test.
Russell Bryant [Mon, 30 Jul 2012 13:45:42 +0000 (13:45 +0000)]
Fix ast_event_new unit test.

One of my recent commits broke this test.  The error was:

[test_event.c:event_new_test:214]: Events expected to be identical
have different size: 69 != 59

The difference in size occurred because the first event had
the EID IE added to the event twice.  ast_event_new() now always
adds it automatically.  Previously it only added it if there
were no IEs specified, which was kind of weird.

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

7 years agoAdd a "corosync ping" CLI command.
Russell Bryant [Mon, 30 Jul 2012 00:14:18 +0000 (00:14 +0000)]
Add a "corosync ping" CLI command.

This patch adds a new CLI command to the res_corosync module.  It is primarily
used as a debugging tool.  It lets you fire off an event which will cause
res_corosync on other nodes in the cluster to place messages into the logger if
everything is working ok.  It verifies that the corosync communication is
working as expected.

I didn't put anything in the CHANGES file for this, because this module is new
in Asterisk 11.  There is already a generic "res_corosync new module" entry in
there so I figure that covers it just fine.

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

7 years agoAllow specifying a port number for the MySQL server.
Russell Bryant [Mon, 30 Jul 2012 00:05:25 +0000 (00:05 +0000)]
Allow specifying a port number for the MySQL server.

This patch allows you to specify a port number for the MySQL server.
It's useful if a MySQL server is running on a non-standard port.
Even though this module is deprecated in favor of func_odbc, someone
asked for this feature and it seems pretty harmless to add.

It has been tested using a number of combinations of with/without a
port number specified in the dialplan and changing the port number
 for mysqld.

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

7 years agochan_sip: Add SIPpeerstatus command to AMI
Jonathan Rose [Thu, 26 Jul 2012 15:31:05 +0000 (15:31 +0000)]
chan_sip: Add SIPpeerstatus command to AMI

This patch was submitted by mnicholson a while back. It adds a new AMI action
which allows users to request SIP peer status on demand similar to existing
PeerStatus events and to the output you would see from CLI with sip show peer

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

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

7 years agores_agi: Add message indicating need for \n character in verbose message
Jonathan Rose [Wed, 25 Jul 2012 21:22:34 +0000 (21:22 +0000)]
res_agi: Add message indicating need for \n character in verbose message

The while loop responsible for reading AGI messages from a fastAGI service
can end up looping indefinitely when an AGI script fails to indicate the end
of a message with a \n character. This patch adds an indication that we are
expecting a \n character to end the message to make it more clear to users
that this is necessary if they are receiving this warning over and over.

(issue ASTERISK-20061)
Reported by: Eike Kuiper
........

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

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

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

7 years agoRepair editline builds using in-tree editline sources.
Kevin P. Fleming [Wed, 25 Jul 2012 14:27:48 +0000 (14:27 +0000)]
Repair editline builds using in-tree editline sources.

The previous change to the build system for using a system-provided editline
library was missing a crucial include directory for building against the
copy of the library in the Asterisk source tree.

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

7 years agoUse an absolute path when referring to the embedded editline directory.
Kevin P. Fleming [Wed, 25 Jul 2012 12:37:58 +0000 (12:37 +0000)]
Use an absolute path when referring to the embedded editline directory.

This patch changes the build system to refer to the embedded editline directory
using an absolute path, which will resolve a problem seen on the CentOS
automated build agents.

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

7 years agoEnable usage of system-provided NetBSD editline library if available.
Kevin P. Fleming [Wed, 25 Jul 2012 12:21:54 +0000 (12:21 +0000)]
Enable usage of system-provided NetBSD editline library if available.

This patch changes the Asterisk configure script and build system to detect
the presence of the NetBSD editline library (libedit) on the system. If it is
found, it will be used in preference to the version included in the Asterisk
source tree.

(closes issue ASTERISK-18725)
Reported by: Jeffrey C. Ollie
Review: https://reviewboard.asterisk.org/r/1528/
Patches:
  0001-Allow-linking-building-against-an-external-editline.patch uploaded by jcollie (license #5373) (heavily modified by kpfleming)

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

7 years agoRevert a change that broke compilation
Terry Wilson [Wed, 25 Jul 2012 03:51:28 +0000 (03:51 +0000)]
Revert a change that broke compilation

1) There is no such function as ast_ref()
2) The patch was originally credited as the one uploaded by Guenther
   Kelleter (license 6372) via issue AST-921, but the patch committed
   was not the patch referenced on the issue.
3) Guenther Kelleter's patch was actually correct. It moved the
   ast_free above the presencechange_cleanup label. I am not
   committing his change as it is not technically necesary--calling
   ast_free(NULL) is perfectly safe and I worry that moving the
   ast_free outside of the label could lead to future bugs if
   someone ever adds another failure conditional and expects
   'goto presencechange_cleanup;' to clean up after everything.

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

7 years agoDon't attempt free of NULL ptr in pbx.c handle_presencechange
Jonathan Rose [Tue, 24 Jul 2012 21:30:21 +0000 (21:30 +0000)]
Don't attempt free of NULL ptr in pbx.c handle_presencechange

(closes issue AST-921)
Reported by: Guenther Kelleter
Patches:
    nullptr.patch uploaded by Guenther Kelleter (license 6372)

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

7 years agoSilence a warning message from older versions of GCC.
Kevin P. Fleming [Tue, 24 Jul 2012 19:12:09 +0000 (19:12 +0000)]
Silence a warning message from older versions of GCC.

Revision 370426 introduced the use of a nested function in tests/test_acl.c,
but the lack of the 'auto' scope specifier on the function and a forward
declaration resulted in compilation errors on the automated test systems.

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

7 years agochan_oss: fix "sample rate" error message
Tzafrir Cohen [Tue, 24 Jul 2012 17:16:40 +0000 (17:16 +0000)]
chan_oss: fix "sample rate" error message

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

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

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

7 years agoRewrite a comment that didn't adequately explain the code it was documenting.
Kevin P. Fleming [Tue, 24 Jul 2012 16:54:26 +0000 (16:54 +0000)]
Rewrite a comment that didn't adequately explain the code it was documenting.
........

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

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

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

7 years agoUpdate CHANGES for list/negation ACL feature.
Kevin P. Fleming [Tue, 24 Jul 2012 16:48:45 +0000 (16:48 +0000)]
Update CHANGES for list/negation ACL feature.

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

7 years agoAllow permit/deny ACL lines to contain multiple items and negated entries.
Kevin P. Fleming [Tue, 24 Jul 2012 16:47:33 +0000 (16:47 +0000)]
Allow permit/deny ACL lines to contain multiple items and negated entries.

Rules in ACLs (specified using 'permit' and 'deny') can now contain multiple
items (separated by commas), and items in the rule can be negated by prefixing
them with '!'. This simplifies Asterisk Realtime configurations, since it is no
longer necessray to control the order that the 'permit' and 'deny' columns are
returned from queries.

Review: https://reviewboard.asterisk.org/r/1592/
Initial patch contributed by Tilghman Lesher
Unit tests written by Kevin P. Fleming

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

7 years agoBuild is underway so logging can go away.
Joshua Colp [Tue, 24 Jul 2012 16:15:30 +0000 (16:15 +0000)]
Build is underway so logging can go away.

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

7 years agoTemporarily enable pj logging to console for debugging pjnath issue exposed by build...
Joshua Colp [Tue, 24 Jul 2012 16:09:39 +0000 (16:09 +0000)]
Temporarily enable pj logging to console for debugging pjnath issue exposed by build slave.

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

7 years agoRemove code, that operate with cdr in attempt_transfer(). That was removed somewhere...
Igor Goncharovskiy [Tue, 24 Jul 2012 08:53:01 +0000 (08:53 +0000)]
Remove code, that operate with cdr in attempt_transfer(). That was removed somewhere between 1.2 and 1.4 and acidentaly put back in chan_unistim.

(closes issue ASTERISK-19628)
Reported by: Igor Olhovskiy

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

7 years agoEnable usage of system-provided iLBC library.
Kevin P. Fleming [Mon, 23 Jul 2012 21:27:56 +0000 (21:27 +0000)]
Enable usage of system-provided iLBC library.

The WebRTC version of the iLBC codec is now package as a library and is
available on some platforms. This patch allows codec_ilbc to be built against
that library if it is present.

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

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

7 years agoUnit tests for the Jitter Buffer API; remove unnecessary resync
Matthew Jordan [Mon, 23 Jul 2012 21:15:26 +0000 (21:15 +0000)]
Unit tests for the Jitter Buffer API; remove unnecessary resync

This patch includes the following:
* Unit tests for the abstract Jitter Buffer API.  This includes both fixed
  and adaptive flavors, testing nominal creation, frame input, frame retrieval,
  resyncing; off nominal frame input overflow, out of order, and others.
* Tweaks to the abstract_jb API to remove the unnecessary resync_threshold
  parameter from the create function (resync_threshold is already in the
  struct passed into the create function)
* Ensure the fixed jitter buffer is empty before destroying it, to avoid an
  ASSERT
* Don't "resync" the adaptive jitter buffer.  The mechanism that was being
  used actually causes the jitter buffer to think its being overflowed by going
  around the jitterbuf API and attempting to 'resynch' it improperly.  If a
  resync is needed, the jitter buffer will do it properly by itself.  Note that
  this is only an optimization needed for trunk, as the worst that happens is
  the loss of three voice packets before the adaptive jitter buffer will resync
  anyway.

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

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

7 years agoAdd separate configuration options for subscription and registration minexpiry and...
Mark Michelson [Mon, 23 Jul 2012 21:10:54 +0000 (21:10 +0000)]
Add separate configuration options for subscription and registration minexpiry and maxexpiry.

This offers more fine-grained control over how long subscriptions last without negatively
affecting the expiration range for registrations.

Uploaded by:
Guenther Kelleter(license #6372)

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

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

7 years agoImprove documentation for the SHELL() dialplan function.
Kevin P. Fleming [Mon, 23 Jul 2012 21:10:27 +0000 (21:10 +0000)]
Improve documentation for the SHELL() dialplan function.
........

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

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

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

7 years agoAdd notes to UPGRADE.txt about addition of msg_id to VoiceMails.
Mark Michelson [Mon, 23 Jul 2012 21:02:52 +0000 (21:02 +0000)]
Add notes to UPGRADE.txt about addition of msg_id to VoiceMails.

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

7 years agoBlocked revisions 370361
Kevin P. Fleming [Mon, 23 Jul 2012 14:51:45 +0000 (14:51 +0000)]
Blocked revisions 370361

........
Free any datastores attached to dummy channels.

Revision 370205 added the use of a datastore attached to a dummy channel to
resolve a memory leak, but ast_dummy_channel_destructor() in this branch did
not free datastores, resulting in a continued (but slightly smaller) memory
leak. This patch backports the change to free said datastores from the Asterisk
trunk.

(related to issue AST-916)
........

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

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

7 years agoUpdate UPGRADE.txt with notes about ICE support and res_xmpp.
Joshua Colp [Mon, 23 Jul 2012 00:15:39 +0000 (00:15 +0000)]
Update UPGRADE.txt with notes about ICE support and res_xmpp.

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

7 years agoUpdate CHANGES for Asterisk 11
Matthew Jordan [Sun, 22 Jul 2012 23:37:00 +0000 (23:37 +0000)]
Update CHANGES for Asterisk 11

This updates the CHANGES file with things that were committed for
Asterisk 11, but were not noted in that file.

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

7 years agoPrevent multiple local candidates from being added with the same information and...
Joshua Colp [Sun, 22 Jul 2012 17:03:24 +0000 (17:03 +0000)]
Prevent multiple local candidates from being added with the same information and add support for disabling ICE on a per-peer basis.

(closes issue ASTERISK-20088)
Reported by: wimpy

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

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

7 years agoFix segfault introduced by conversion to ACO API
Terry Wilson [Sat, 21 Jul 2012 13:25:26 +0000 (13:25 +0000)]
Fix segfault introduced by conversion to ACO API

The value "none" is specified in the config file as a valid value for
the "video_mode" option. The code prior to the ACO conversion did not
check for "none", but just ignored it and relied on the default zero
value. The parsing with ACO is more strict, so without handling
"none" specifically, parsing would fail.

When parsing failed, but the module loaded anyway, the config info
would never be stored, and one place in the code did not check for
this case and would segfault. It was also possible that the
aco_info struct's internals would be destroyed and used as well.

This patch keeps the module from loading after parse failures, adds
the "none" option to "video_mode", registers CLI functions only
after parsing has completed, checks the config data for NULL before
accessing it, and returns -1 on some allocation failures when
initializing.

(closes issue ASTERISK-20159)
Reported by: Birger "WIMPy" Harzenetter
Tested by: Birger "WIMPy" Harzenetter
Patches:
    confbridge_fix3.txt uploaded by Terry Wilson

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

7 years agochan_iax2: Fix a segfault introduced by call ID logging
Jonathan Rose [Fri, 20 Jul 2012 19:36:05 +0000 (19:36 +0000)]
chan_iax2: Fix a segfault introduced by call ID logging

Didn't previously check that a non NULL IAX channel was stored in the array
at the requested position before attempting iax_pvt_callid_get

(closes issue ASTERISK-20145)
Reported by: Birger "WIMPy" Harzenetter

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

7 years agoClean up ManagerEvent Dial documentation
Matthew Jordan [Fri, 20 Jul 2012 19:08:47 +0000 (19:08 +0000)]
Clean up ManagerEvent Dial documentation

The paragraph describing the SubEvent belongs with the SubEvent parameter
itself, and not with its enum values.  The order of parsing was placing
the description after the last enum, which isn't correct.

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