asterisk/asterisk.git
10 years agoAdd unit test for testing ACL functionality.
Mark Michelson [Thu, 25 Mar 2010 17:52:20 +0000 (17:52 +0000)]
Add unit test for testing ACL functionality.

There are two unit tests contained here.

1. "Invalid ACL" This attempts to read a bunch of badly formatted ACL entries
and add them to a host access rule. The goal of this test is to be sure that
all invalid entries are rejected as they should be.

2. "ACL" This sets up four ACLs. One is a permit all, one is a deny all, and
the other two have specific rules about which subnets are allowed and which
are not. Then a set of test addresses is used to determine whether we would
allow those addresses to access us when each ACL is applied. This test, by the
way, was what resulted in AST-2010-003's creation.

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

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

10 years agoMerged revisions 254552 via svnmerge from
Mark Michelson [Thu, 25 Mar 2010 17:42:36 +0000 (17:42 +0000)]
Merged revisions 254552 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254552 | mmichelson | 2010-03-25 12:33:35 -0500 (Thu, 25 Mar 2010) | 5 lines

  Add doxygen for acl.h

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

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

10 years agoAdd new rtpsource options to the CHANNEL function.
Mark Michelson [Thu, 25 Mar 2010 17:29:47 +0000 (17:29 +0000)]
Add new rtpsource options to the CHANNEL function.

This adds rtpsource options analogous to the rtpdest
functions that already exist. In addition, this fixes
potential crashes which could result due to trying to
read values from nonexistent RTP streams.

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

10 years agoRecorded merge of revisions 254452 via svnmerge from
Mark Michelson [Thu, 25 Mar 2010 16:04:48 +0000 (16:04 +0000)]
Recorded merge of revisions 254452 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254452 | mmichelson | 2010-03-25 10:59:56 -0500 (Thu, 25 Mar 2010) | 44 lines

  Several fixes regarding RFC2833 DTMF detection.

  Here is a copy and paste of the details from my request on
  reviewboard that dealt with these changes:

  Fix 1. The first change in place is to fix Mantis issue 15811, which deals with a situation where Asterisk will incorrectly interpret out of order RFC2833 frames as duplicate DTMF digits. For instance, we would receive a sequence like:

  seqno 1: DTMF 1
  seqno 2: DTMF 1
  seqno 3: DTMF 1
  seqno 4: DTMF 1
  seqno 6: DTMF 1 (end)
  seqno 5: DTMF 1
  seqno 7: DTMF 1 (end)
  seqno 8: DTMF 1 (end)

  Prior to this patch when we received the frame with seqno 5, we would interpret this as a new DTMF 1. With this patch, we will check the seqno of the incoming digit and not process the frame if the seqno is lower than the last recorded seqno. Note that we do not record the seqno of the dropped DTMF frame for future processing. While the above situation is what was designed to be fixed, the patch is written in such a way that the following would also be fixed too:

  seqno  9: DTMF 1
  seqno 10: DTMF 1 (end)
  seqno 11: DTMF 1 (end)
  seqno 13: DTMF 2
  seqno 12: DTMF 1 (end)
  seqno 14: DTMF 2
  seqno 15: DTMF 2 (end)
  seqno 16: DTMF 2 (end)
  seqno 17: DTMF 2 (end)

  In this second situation, the beginning of the DTMF 2 arrives before the final end frame of the DTMF 1. With the patch, seqno 12 is no processed and thus we properly interpret the DTMF.

  Fix 2. The second change in place is to fix an issue like the following:

  seqno 1: DTMF 1
  seqno 2: DTMF 1
  seqno 3: DTMF 1 (end) *packet lost*
  seqno 4: DTMF 1 (end) *packet lost*
  seqno 5: DTMF 1 (end) *packet lost*
  seqno 6: DTMF 2

  When we receive seqno 6, we had code in place that was supposed to properly end the previously unended DTMF 1. The problem was that the code was essentially a no-op. The code would set up an end frame for the DTMF 1 but would immediately overwrite the frame with the begin for DTMF 2. I changed process_dtmf_rfc2833() so that instead of returning a single frame, it is given as an output parameter a list of frames. Each frame that needs to be returned is appended to this list.

  Fix 3. The final change is a minor one where an AST_CONTROL_SRCCHANGE frame could get lost. If we process a cisco DTMF or an RFC 3389 frame and no frame was returned, then we would return &ast_null_frame. The problem is that earlier in the function, we may have generated an AST_CONTROL_SRCCHANGE frame and put it in the list of frames we wish to return. This frame would be lost in such a case. The patch fixes this problem
........

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

10 years agoMerged revisions 254451 via svnmerge from
Terry Wilson [Thu, 25 Mar 2010 16:03:51 +0000 (16:03 +0000)]
Merged revisions 254451 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254451 | twilson | 2010-03-25 10:57:29 -0500 (Thu, 25 Mar 2010) | 2 lines

  Handle new SRCCHANGE control message here too
........

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

10 years agoImprove handling of T.38 re-INVITEs that arrive before a T.38-capable
Kevin P. Fleming [Thu, 25 Mar 2010 15:27:31 +0000 (15:27 +0000)]
Improve handling of T.38 re-INVITEs that arrive before a T.38-capable
application is executing on a channel.

This patch addresses an issue found during working with end-users
using res_fax. If an incoming call is answered in the dialplan, or
jumps to the 'fax' extension due to reception of a CNG tone (with
faxdetect enabled), and then the remote endpoint sends a T.38
re-INVITE, it is possible for the channel's T.38 state to be
'T38_STATE_NEGOTIATING' when the application starts up. Unfortunately,
even if the application wants to use T.38, it can't respond to the
peer's negotiation request, because the AST_CONTROL_T38_PARAMETERS
control frame that chan_sip sent originally has been lost, and the
application needs the content of that frame to be able to formulate a
reply.

This patch adds a new 'request' type to AST_CONTROL_T38_PARAMETERS,
AST_T38_REQUEST_PARMS. If the application sends this request, chan_sip
will re-send the original control frame (with
AST_T38_REQUEST_NEGOTIATE as the request type), and the application
can respond as normal. If this occurs within the five second timeout
in chan_sip, the automatic cancellation of the peer reinvite will be
stopped, and the application will 'own' the negotiation process from
that point onwards.

This also improves the code path in chan_sip to allow sip_indicate(),
when called for AST_CONTROL_T38_PARAMETERS, to be able to return a
non-zero response, which should have been in place before since the
control frame *can* fail to be processed properly. It also modifies
ast_indicate() to return whatever result the channel driver returned
for this control frame, rather than converting all non-zero results
into '-1'. Finally, the new request type intentionally returns a
positive value, so that an application that sends
AST_T38_REQUEST_PARMS can know for certain whether the channel driver
accepted it and will be replying with a control frame of its own, or
whether it was ignored (if the sip_indicate()/ast_indicate() path had
properly supported failure responses before, this would not be
necessary).

This patch also modifies res_fax to take advantage of the new request.

In addition, this patch makes sip_t38_abort() actually lock the
private structure before doing its work... bad programmer, no donut.

This patch also enhances chan_sip's 'faxdetect' support to allow
triggering on T.38 re-INVITEs received as well as CNG tone detection.

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

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

10 years agohandle_speechset has 4 arguments.
Leif Madsen [Thu, 25 Mar 2010 15:21:26 +0000 (15:21 +0000)]
handle_speechset has 4 arguments.

Update code to reflect that handle_speechset has 4 arguments.

(closes issue #17093)
Reported by: gpatri
Patches:
      res_agi.patch uploaded by gpatri (license 1014)
Tested by: pabelanger, mmichelson

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

10 years agoremove unneeded explicit channel in dahdi ioctls
Tzafrir Cohen [Thu, 25 Mar 2010 10:09:24 +0000 (10:09 +0000)]
remove unneeded explicit channel in dahdi ioctls

This patch removes some cases where the channel number for an ioctl was
passed as a member in a struct rather then through the file descriptor.

The gain setting functions passed around a channel which is always 0,
and thus this parameter is simply dropped.

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

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

10 years agoFix potential invalid reads that could occur in pbx.c
Mark Michelson [Wed, 24 Mar 2010 21:10:38 +0000 (21:10 +0000)]
Fix potential invalid reads that could occur in pbx.c

Here is a cut and paste of my review request for this change:
This past weekend, Russell ran our current suite of unit tests for Asterisk
under valgrind. The PBX pattern match test caused valgrind to spew forth two
invalid read errors. This patch contains two changes that shut valgrind up and
do not cause any new memory leaks.

Change 1: In ast_context_remove_extension_callerid2, valgrind reported an
invalid read in the for loop close to the function's end. Specifically, one of
the the strcmp calls in the loop control was reading invalid memory. This was
because the caller of ast_context_remove_extension_callerid2 (__ast_context
destroy in this case) passed as a parameter a shallow copy of an ast_exten's
exten field. This same ast_exten was what was destroyed inside the for loop,
thus any iterations of the for loop beyond the destruction of the ast_exten
would result in invalid reads. My fix for this is to make a copy of the
ast_exten's exten field and pass the copy to
ast_context_remove_extension_callerid2. In addition, I have also acted
similarly with the ast_exten's matchcid field. Since in this case a NULL is
handled quite differently than an empty string, I needed to be a bit more
careful with its handling.

Change 2: In __ast_context_destroy, we iterated over a hashtab and called
ast_context_remove_extension_callerid2 on each item. Specifically, the hashtab
over which we were iterating was an ast_exten's peer_table. Inside of
ast_context_remove_extension_callerid2, we could possibly destroy this
ast_exten, which also caused the hashtab to be freed. Attempting to call
ast_hashtab_end_traversal on the hashtab iterator caused an invalid read to
occur when trying to read the iterator->tab->do_locking field since
iterator->tab had already been freed. My handling of this problem is a bit less
straightforward. With each iteration over the hashtab's contents, we set a
variable called "end_traversal" based on the return of
ast_context_remove_extension_callerid2. If 0 is ever returned, then we know
that the extension was found and destroyed. Because of this, we cannot call
ast_hashtab_end_traversal because we will be guaranteeing a read of invalid
memory. In such a case, we forego calling ast_hashtab_end_traversal and instead
call ast_free on the hashtab iterator.

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

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

10 years agoAllow configuration of minsecs and nextaftercmd per mailbox.
Jeff Peeler [Wed, 24 Mar 2010 18:13:29 +0000 (18:13 +0000)]
Allow configuration of minsecs and nextaftercmd per mailbox.

Previously only configurable globally. A unit test has also been written to
provide protection against parse failures for supported mailbox options.

(closes issue #16864)
Reported by: kobaz
Patches:
      voicemail2.patch uploaded by kobaz (license 834)

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

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

10 years agoMerged revisions 254235 via svnmerge from
Jeff Peeler [Wed, 24 Mar 2010 17:15:05 +0000 (17:15 +0000)]
Merged revisions 254235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254235 | jpeeler | 2010-03-23 19:37:23 -0500 (Tue, 23 Mar 2010) | 72 lines

  Ensure that monitor recordings are written to the correct location (again)

  This is an extension to 248860. As such the dialplan test has been extended:

  ; non absolute path, not combined
  exten => 5040, 1, monitor(wav,tmp/jeff/monitor_test)
  exten => 5040, n, dial(sip/5001)
  ; absolute path, not combined
  exten => 5041, 1, monitor(wav,/tmp/jeff/monitor_test2)
  exten => 5041, n, dial(sip/5001)
  ; no path, not combined
  exten => 5042, 1, monitor(wav,monitor_test3)
  exten => 5042, n, dial(sip/5001)
  ; combined: changemonitor from non absolute to no path (leaves tmp/jeff)
  exten => 5043, 1, monitor(wav,tmp/jeff/monitor_test4,m)
  exten => 5043, n, changemonitor(monitor_test5)
  exten => 5043, n, dial(sip/5001)
  ; combined: changemonitor from no path to non absolute path
  exten => 5044, 1, monitor(wav,monitor_test6,m)
  exten => 5044, n, changemonitor(tmp/jeff/monitor_test7) ; this wasn't possible before
  exten => 5044, n, dial(sip/5001)
  ; non absolute path, combined
  exten => 5045, 1, monitor(wav,tmp/jeff/monitor_test8,m)
  exten => 5045, n, dial(sip/5001)
  ; absolute path, combined
  exten => 5046, 1, monitor(wav,/tmp/jeff/monitor_test9,m)
  exten => 5046, n, dial(sip/5001)
  ; no path, combined
  exten => 5047, 1, monitor(wav,monitor_test10,m)
  exten => 5047, n, dial(sip/5001)
  ; combined: changemonitor from non absolute to absolute (leaves tmp/jeff)
  exten => 5048, 1, monitor(wav,tmp/jeff/monitor_test11,m)
  exten => 5048, n, changemonitor(/tmp/jeff/monitor_test12)
  exten => 5048, n, dial(sip/5001)
  ; combined: changemonitor from absolute to non absolute (leaves /tmp/jeff)
  exten => 5049, 1, monitor(wav,/tmp/jeff/monitor_test13,m)
  exten => 5049, n, changemonitor(tmp/jeff/monitor_test14)
  exten => 5049, n, dial(sip/5001)
  ; combined: changemonitor from no path to absolute
  exten => 5050, 1, monitor(wav,monitor_test15,m)
  exten => 5050, n, changemonitor(/tmp/jeff/monitor_test16)
  exten => 5050, n, dial(sip/5001)
  ; combined: changemonitor from absolute to no path (leaves /tmp/jeff)
  exten => 5051, 1, monitor(wav,/tmp/jeff/monitor_test17,m)
  exten => 5051, n, changemonitor(monitor_test18)
  exten => 5051, n, dial(sip/5001)
  ; not combined: changemonitor from non absolute to no path (leaves tmp/jeff)
  exten => 5052, 1, monitor(wav,tmp/jeff/monitor_test19)
  exten => 5052, n, changemonitor(monitor_test20)
  exten => 5052, n, dial(sip/5001)
  ; not combined: changemonitor from no path to non absolute
  exten => 5053, 1, monitor(wav,monitor_test21)
  exten => 5053, n, changemonitor(tmp/jeff/monitor_test22)
  exten => 5053, n, dial(sip/5001)
  ; not combined: changemonitor from non absolute to absolute (leaves tmp/jeff)
  exten => 5054, 1, monitor(wav,tmp/jeff/monitor_test23)
  exten => 5054, n, changemonitor(/tmp/jeff/monitor_test24)
  exten => 5054, n, dial(sip/5001)
  ; not combined: changemonitor from absolute to non absolute (leaves /tmp/jeff)
  exten => 5055, 1, monitor(wav,/tmp/jeff/monitor_test24)
  exten => 5055, n, changemonitor(tmp/jeff/monitor_test25)
  exten => 5055, n, dial(sip/5001)
  ; not combined: changemonitor from no path to absolute
  exten => 5056, 1, monitor(wav,monitor_test26)
  exten => 5056, n, changemonitor(/tmp/jeff/monitor_test27)
  exten => 5056, n, dial(sip/5001)
  ; not combined: changemonitor from absolute to no path (leaves /tmp/jeff)
  exten => 5057, 1, monitor(wav,/tmp/jeff/monitor_test28)
  exten => 5057, n, changemonitor(monitor_test29)
  exten => 5057, n, dial(sip/5001)
........

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

10 years agomake 'core show settings' should show all settable directories
Tzafrir Cohen [Tue, 23 Mar 2010 22:48:03 +0000 (22:48 +0000)]
make 'core show settings' should show all settable directories

(closes issue #17086)
Reported by: tzafrir
Patches:
      asterisk_extra_settings_dirs.diff uploaded by tzafrir (license 46)

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

10 years agoPut test output for a failure in a CDATA section in the XML results.
Russell Bryant [Tue, 23 Mar 2010 22:35:56 +0000 (22:35 +0000)]
Put test output for a failure in a CDATA section in the XML results.

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

10 years agoExit native bridging early for greater timing accuracy with warnings
Jeff Peeler [Tue, 23 Mar 2010 21:17:23 +0000 (21:17 +0000)]
Exit native bridging early for greater timing accuracy with warnings

This changes native bridging to break one millisecond early so that the more
accurate timeval calculations done in the generic bridge can be performed using
the bridge config. Currently the time between exiting native bridging slightly
late can sometimes cause a large enough discrepancy for warnings to be missed.
For the record, 1.4 does not attempt to native bridge at all when warnings are
enabled.

(closes issue #15815)
Reported by: adomjan

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

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

10 years agoBlocked revisions 254046 via svnmerge
Jason Parker [Tue, 23 Mar 2010 21:09:32 +0000 (21:09 +0000)]
Blocked revisions 254046 via svnmerge

........
  r254046 | qwell | 2010-03-23 16:07:54 -0500 (Tue, 23 Mar 2010) | 9 lines

  Allow out-of-tree modules to load, regardless of DEBUG_THREADS/DEBUG_CHANNEL_LOCKS differences.

  This can be guaranteed by forcing the ABI to no longer change when these compiler flags are set.
  An unfortunate side-effect to this is that there is an ABI change here.  However, there is some
  mitigation.  Existing modules *will* fail to load since they would require functions that no
  longer exist.

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

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

10 years agoRemove unused structure member in app_queue.
Sean Bright [Tue, 23 Mar 2010 20:52:35 +0000 (20:52 +0000)]
Remove unused structure member in app_queue.

(closes issue #15494)
Reported by: makoto

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

10 years agoChange the name of the category 'TEST' to match the name of the subdir
Tzafrir Cohen [Tue, 23 Mar 2010 19:19:52 +0000 (19:19 +0000)]
Change the name of the category 'TEST' to match the name of the subdir

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

10 years agoDon't act like an http write failed when it didn't
Terry Wilson [Tue, 23 Mar 2010 16:52:53 +0000 (16:52 +0000)]
Don't act like an http write failed when it didn't

fwrite returns the number of items written, not the number of bytes

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

10 years agoChange per-file debug and verbose levels to be per-module, the way
Kevin P. Fleming [Tue, 23 Mar 2010 14:22:27 +0000 (14:22 +0000)]
Change per-file debug and verbose levels to be per-module, the way
users expect them to work.

'core set debug' and 'core set verbose' can optionally change the
level for a specific filename; however, this is actually for a
specific source file name, not the module that source file is included
in. With examples like chan_sip, chan_iax2, chan_misdn and others
consisting of multiple source files, this will not lead to the
behavior that users expect. If they want to set the debug level for
chan_sip, they want it set for all of chan_sip, and not to have to
also set it for reqresp_parser and other files that comprise the
chan_sip module.

This patch changes this functionality to be module-name based instead
of file-name based.

To make this work, some Makefile modifications were required to ensure
that the AST_MODULE definition is present in each object file produced
for each module as well.

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

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

10 years agoInitialize channels prior to loading "preload" modules.
Mark Michelson [Mon, 22 Mar 2010 20:32:15 +0000 (20:32 +0000)]
Initialize channels prior to loading "preload" modules.

We can have bad results when a module, upon being loaded, attempts
to reference the channels container if the container hasn't yet
been initialized. I saw this happen by trying to preload pbx_config.so
and having a hint defined which referenced a non-existent SIP peer.

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

10 years agoMerged revisions 253799 via svnmerge from
Matthew Nicholson [Mon, 22 Mar 2010 19:52:52 +0000 (19:52 +0000)]
Merged revisions 253799 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r253799 | mnicholson | 2010-03-22 14:50:00 -0500 (Mon, 22 Mar 2010) | 4 lines

  Unconditionally copy the caller's account code to the called party.

  (related to issue #16331)
........

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

10 years agoUpdate query should be an UPDATE, not a SELECT.
Tilghman Lesher [Mon, 22 Mar 2010 19:05:27 +0000 (19:05 +0000)]
Update query should be an UPDATE, not a SELECT.

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

10 years agoReturn the list for later manipulation. This fixes an issue with the update procedure.
Tilghman Lesher [Mon, 22 Mar 2010 18:58:48 +0000 (18:58 +0000)]
Return the list for later manipulation.  This fixes an issue with the update procedure.

Debugging with mmichelson.

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

10 years agoAccomodate equal signs in DSNs and add documentation, based upon mmichelson's feedback.
Tilghman Lesher [Mon, 22 Mar 2010 16:59:35 +0000 (16:59 +0000)]
Accomodate equal signs in DSNs and add documentation, based upon mmichelson's feedback.

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

10 years agoFix memory corruption found by unit tests.
Russell Bryant [Sat, 20 Mar 2010 16:50:38 +0000 (16:50 +0000)]
Fix memory corruption found by unit tests.

ast_str_reset() was being called on a potentially uninitialized pointer.
Valgrind is my hero, once again.

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

10 years agoResolve more compiler warnings on FreeBSD.
Russell Bryant [Sat, 20 Mar 2010 12:03:07 +0000 (12:03 +0000)]
Resolve more compiler warnings on FreeBSD.

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

10 years agoInclude sys/wait.h on FreeBSD to get the WEXITSTATUS() macro.
Russell Bryant [Sat, 20 Mar 2010 11:47:40 +0000 (11:47 +0000)]
Include sys/wait.h on FreeBSD to get the WEXITSTATUS() macro.

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

10 years agoResolve compiler warnings on FreeBSD.
Russell Bryant [Sat, 20 Mar 2010 11:43:08 +0000 (11:43 +0000)]
Resolve compiler warnings on FreeBSD.

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

10 years agoResolve a compiler warning on FreeBSD.
Russell Bryant [Sat, 20 Mar 2010 11:39:39 +0000 (11:39 +0000)]
Resolve a compiler warning on FreeBSD.

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

10 years agoUse SHRT_MAX instead of MAXSHORT.
Russell Bryant [Sat, 20 Mar 2010 11:33:30 +0000 (11:33 +0000)]
Use SHRT_MAX instead of MAXSHORT.

These changes fix build issues I had with this module on FreeBSD.

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

10 years agoprevent segfault if bad magic number is encountered.
Alec L Davis [Fri, 19 Mar 2010 07:37:00 +0000 (07:37 +0000)]
prevent segfault if bad magic number is encountered.

internal_ao2_ref uses INTERNAL_OBJ which mzy report 'bad magic number', but
internal_ao2_ref continues on, causing segfault.

Although AO2_MAGIC number is checked by INTERNAL_OBJ before internal_ao2_ref is
called, A02_MAGIC is being destroyed (or a wrong pointer) by the time
internal_ao2_ref uses INTERNAL_OBJ.

internal_ao2_ref now returns -1 if INTERNAL_OBJ encouters a bad magic number.

(issue #17037)
Reported by: alecdavis
Patches:
      bug17037.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

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

10 years agoUpdate comment to reflect new timeout value.
Russell Bryant [Thu, 18 Mar 2010 18:23:07 +0000 (18:23 +0000)]
Update comment to reflect new timeout value.

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

10 years agoIncrease CLI command output timeout for asterisk -rx to 60 seconds.
Russell Bryant [Thu, 18 Mar 2010 18:18:43 +0000 (18:18 +0000)]
Increase CLI command output timeout for asterisk -rx to 60 seconds.

(closes issue #17049)
Reported by: russell
Tested by: russell

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

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

10 years agoChange usage of pipe to comma in UserEvent docs.
Leif Madsen [Thu, 18 Mar 2010 17:52:35 +0000 (17:52 +0000)]
Change usage of pipe to comma in UserEvent docs.

Change the example usage of pipe as a separator to comma in the UserEvent
documentation.

(closes issue #16961)
Reported by: jlpedrosa

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

10 years agoPrevent a crash when a buddy gets offline.
Philippe Sultan [Thu, 18 Mar 2010 15:59:19 +0000 (15:59 +0000)]
Prevent a crash when a buddy gets offline.

(closes issue #16760)
Reported by: fiddur
Patches:
      248394.diff uploaded by fiddur (license 678)i with modifications by me
Tested by: fiddur, phsultan

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

10 years agoUpdate to new Local channel documentation.
Leif Madsen [Thu, 18 Mar 2010 15:46:52 +0000 (15:46 +0000)]
Update to new Local channel documentation.

Add same changes as commit to 1.4, but convert to TeX.

(issue #16963)
Reported by: kobaz
Patches:
      localchannel-2.txt uploaded by kobaz (license 834)

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

10 years agoJust in case of a race, send the signal on interrupt.
Tilghman Lesher [Thu, 18 Mar 2010 15:45:26 +0000 (15:45 +0000)]
Just in case of a race, send the signal on interrupt.

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

10 years agomain/test.c reports erroneous CLI message.
Leif Madsen [Wed, 17 Mar 2010 19:06:04 +0000 (19:06 +0000)]
main/test.c reports erroneous CLI message.

(closes issue #17051)
Reported by: Nick_Lewis

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

10 years agoSwitch to using intptr_t, as suggested by Kevin Fleming on the -dev list
Tilghman Lesher [Wed, 17 Mar 2010 14:16:54 +0000 (14:16 +0000)]
Switch to using intptr_t, as suggested by Kevin Fleming on the -dev list

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

10 years agoFix a typo.
Leif Madsen [Wed, 17 Mar 2010 00:40:51 +0000 (00:40 +0000)]
Fix a typo.

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

10 years agoMerged revisions 253018 via svnmerge from
Leif Madsen [Wed, 17 Mar 2010 00:29:06 +0000 (00:29 +0000)]
Merged revisions 253018 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r253018 | lmadsen | 2010-03-16 19:26:19 -0500 (Tue, 16 Mar 2010) | 6 lines

  Add french snipset to say.conf.

  Add the french snipset to say.conf.

  (Closes issue #15799)
........

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

10 years agoArgh.
Tilghman Lesher [Wed, 17 Mar 2010 00:23:12 +0000 (00:23 +0000)]
Argh.

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

10 years agoFix bamboo compile error by calculating an integer with the same size as a pointer.
Tilghman Lesher [Wed, 17 Mar 2010 00:14:29 +0000 (00:14 +0000)]
Fix bamboo compile error by calculating an integer with the same size as a pointer.

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

10 years agoMask out previous arguments on each nested invocation of Gosub.
Tilghman Lesher [Tue, 16 Mar 2010 23:49:35 +0000 (23:49 +0000)]
Mask out previous arguments on each nested invocation of Gosub.
(closes issue #16758)
 Reported by: wdoekes
 Patches:
       20100316__issue16758.diff.txt uploaded by tilghman (license 14)

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

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

10 years agoRe-enable test_time on non-Linux.
Russell Bryant [Tue, 16 Mar 2010 19:36:55 +0000 (19:36 +0000)]
Re-enable test_time on non-Linux.

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

10 years agoInclude an extra newline after "Aliased CLI command" to get back the prompt.
Sean Bright [Tue, 16 Mar 2010 19:36:24 +0000 (19:36 +0000)]
Include an extra newline after "Aliased CLI command" to get back the prompt.

The other issue mentioned in this bug will be more difficult to resolve since we
have no idea (right now) of knowing if the command that is aliased has been
installed yet.

(issue #16978)
Reported by: jw-asterisk
Tested by: seanbright

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

10 years agoFix test_time on Mac OS X (and other platforms without inotify)
Tilghman Lesher [Tue, 16 Mar 2010 19:34:01 +0000 (19:34 +0000)]
Fix test_time on Mac OS X (and other platforms without inotify)

Reviewboard: https://reviewboard.asterisk.org/r/554/

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

10 years agoMerged revisions 252766 via svnmerge from
Russell Bryant [Tue, 16 Mar 2010 19:01:04 +0000 (19:01 +0000)]
Merged revisions 252766 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252766 | russell | 2010-03-16 14:00:43 -0500 (Tue, 16 Mar 2010) | 6 lines

  Don't treat warnings as errors for muted.

  muted supports OS X, but uses functions marked as deprecated in 10.6.  However,
  the functions are still supported, so just ignore the warnings for now and
  allow the build to proceed.
........

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

10 years agoMerged revisions 252761 via svnmerge from
Leif Madsen [Tue, 16 Mar 2010 18:48:22 +0000 (18:48 +0000)]
Merged revisions 252761 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252761 | lmadsen | 2010-03-16 13:46:20 -0500 (Tue, 16 Mar 2010) | 7 lines

  Additional extensions.ael global variable fixes.

  Fixing up a couple more overlapping global variable namespaces shared with
  extensions.conf.sample. Also noticed a few of the lines that were commented
  out didn't have the closing semi-colon so I added that as well.

  (issue #17035)
........

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

10 years agoOSARCH is not inherited to this directory
Tilghman Lesher [Tue, 16 Mar 2010 18:40:14 +0000 (18:40 +0000)]
OSARCH is not inherited to this directory

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

10 years agoDisable this test on non-Linux for now.
Russell Bryant [Tue, 16 Mar 2010 18:36:34 +0000 (18:36 +0000)]
Disable this test on non-Linux for now.

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

10 years agoImprove handling of values supplied to FAXOPT(ecm).
Kevin P. Fleming [Mon, 15 Mar 2010 22:48:38 +0000 (22:48 +0000)]
Improve handling of values supplied to FAXOPT(ecm).

Previously, values that began with whitespace were silently treated as 'no',
and all non-'yes' values were also treated as 'no'. Now the supplied value
is specifically checked for a 'yes' or 'no' (or equivalent) value, after skipping
leading whitespace. If the value is not valid, then a warning message is generated.

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

10 years agoTell the RTP engine API about the initial read and write format.
Russell Bryant [Mon, 15 Mar 2010 22:14:18 +0000 (22:14 +0000)]
Tell the RTP engine API about the initial read and write format.

Peer reviewed out-of-band by file.

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

10 years agoResolve a crash in SLATrunk when the specified trunk doesn't exist.
Sean Bright [Mon, 15 Mar 2010 21:55:44 +0000 (21:55 +0000)]
Resolve a crash in SLATrunk when the specified trunk doesn't exist.

Reported by philipp64 in #asterisk-dev.

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

10 years agoMerged revisions 252617 via svnmerge from
Tilghman Lesher [Mon, 15 Mar 2010 21:51:55 +0000 (21:51 +0000)]
Merged revisions 252617 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252617 | tilghman | 2010-03-15 16:43:14 -0500 (Mon, 15 Mar 2010) | 2 lines

  Uh, yeah.  Umask.  I'm stupid.
........

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

10 years agoMerged revisions 252533 via svnmerge from
Leif Madsen [Mon, 15 Mar 2010 20:52:32 +0000 (20:52 +0000)]
Merged revisions 252533 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252533 | lmadsen | 2010-03-15 15:48:56 -0500 (Mon, 15 Mar 2010) | 7 lines

  Update extensions.ael file to not overlap extensions.conf.
  Updated the extensions.ael file so the global variables don't overlap
  those that we have in extensions.conf (sample files). This way unexpected
  things won't happed hopefully if both pbx_ael and res_config are loaded.

  (closes issue #17035)
  Reported by: pprindeville
........

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

10 years agoMake the Makefile logic more explicit and move the Snow Leopard logic down to where...
Tilghman Lesher [Mon, 15 Mar 2010 16:27:08 +0000 (16:27 +0000)]
Make the Makefile logic more explicit and move the Snow Leopard logic down to where it's not executed on non-Darwin systems.

(closes issue #17028)
 Reported by: pabelanger
 Patches:
       issue17028_20100315.patch uploaded by seanbright (license 71)
       20100315__issue17028.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman, pabelanger

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

10 years agoTHIS IS NOT PYTHON. Indentation doesn't matter, only braces do.
Tilghman Lesher [Mon, 15 Mar 2010 04:25:35 +0000 (04:25 +0000)]
THIS IS NOT PYTHON.  Indentation doesn't matter, only braces do.

(closes issue #17025)
 Reported by: smurfix
 Patches:
       sip.patch uploaded by smurfix (license 547)

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

10 years agoRecorded merge of revisions 252366 via svnmerge from
Tilghman Lesher [Mon, 15 Mar 2010 01:39:39 +0000 (01:39 +0000)]
Recorded merge of revisions 252366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252366 | tilghman | 2010-03-14 20:39:00 -0500 (Sun, 14 Mar 2010) | 2 lines

  Typo
........

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

10 years agoMerged revisions 252361 via svnmerge from
Tilghman Lesher [Mon, 15 Mar 2010 01:37:04 +0000 (01:37 +0000)]
Merged revisions 252361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252361 | tilghman | 2010-03-14 20:33:50 -0500 (Sun, 14 Mar 2010) | 4 lines

  Launch Asterisk on Mac OS X with launchd.

  Reviewboard: https://reviewboard.asterisk.org/r/551/
........

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

10 years agoFix building CDR and CEL SQLite3 modules.
Sean Bright [Sun, 14 Mar 2010 17:43:46 +0000 (17:43 +0000)]
Fix building CDR and CEL SQLite3 modules.

They added a sqlite3_log() function which was conflicting with our function
names.

(closes issue #17017)
Reported by: alephlg

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

10 years agogenerate roundtrip delay requests and responses
Alexandr Anikin [Sun, 14 Mar 2010 14:42:59 +0000 (14:42 +0000)]
generate roundtrip delay requests and responses

added response to roundtrip delay requests from opposite side
added roundtrip delay request sending to opposite side after answer,
added options for sending request (interval between request and
count of unreplied requests before forced call hangup)

(closes issue #16976)
Reported by: vmikhelson
Patches:
      rtdr-1.6.0-2.patch uploaded by may213 (license 454)
Tested by: vmikhelson, may213

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

10 years agoResolve unit test failure that occurred on Mac OSX.
Russell Bryant [Sat, 13 Mar 2010 22:21:18 +0000 (22:21 +0000)]
Resolve unit test failure that occurred on Mac OSX.

On Linux (glibc), regcomp() does not return an error for an empty string.
However, the version on OSX will return an error.  The test for channel group
matching by regex now passes on the mac, as well.

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

10 years agoResolve compiler warning by paying attention to system() return value.
Russell Bryant [Sat, 13 Mar 2010 22:17:05 +0000 (22:17 +0000)]
Resolve compiler warning by paying attention to system() return value.

This resolves the last compile failure on bamboo.

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

10 years agoTest script to verify that timezone cache is properly removed on zonefile alteration.
Tilghman Lesher [Fri, 12 Mar 2010 23:18:20 +0000 (23:18 +0000)]
Test script to verify that timezone cache is properly removed on zonefile alteration.

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

10 years agoOnly change the RTP ssrc when we see that it has changed
Terry Wilson [Fri, 12 Mar 2010 22:04:51 +0000 (22:04 +0000)]
Only change the RTP ssrc when we see that it has changed

This change basically reverts the change reviewed in
https://reviewboard.asterisk.org/r/374/ and instead limits the
updating of the RTP synchronization source to only those times when we
detect that the other side of the conversation has changed the ssrc.

The problem is that SRCUPDATE control frames are sent many times where
we don't want a new ssrc, including whenever Asterisk has to send DTMF
in a normal bridge. This is also not the first time that this mistake
has been made. The initial implementation of the ast_rtp_new_source
function also changed the ssrc--and then it was removed because of
this same issue. Then, we put it back in again to fix a different
issue. This patch attempts to only change the ssrc when we see that
the other side of the conversation has changed the ssrc.

It also renames some functions to make their purpose more clear.

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

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

10 years agoadd missing mfcr2_skip_category setting
Moises Silva [Fri, 12 Mar 2010 21:57:40 +0000 (21:57 +0000)]
add missing mfcr2_skip_category setting

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

10 years agoDon't override a user option with the global option.
Tilghman Lesher [Fri, 12 Mar 2010 19:43:23 +0000 (19:43 +0000)]
Don't override a user option with the global option.

(closes issue #16849)
 Reported by: ip-rob
 Patches:
       20100311__issue16849.diff.txt uploaded by tilghman (license 14)
 Tested by: ip-rob

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

10 years agoMerged revisions 251986 via svnmerge from
Richard Mudgett [Fri, 12 Mar 2010 19:40:16 +0000 (19:40 +0000)]
Merged revisions 251986 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r251986 | rmudgett | 2010-03-12 13:33:22 -0600 (Fri, 12 Mar 2010) | 1 line

  Make chan_dahdi wakeup_sub() prototype not conditional.
........

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

10 years agoDoxegen this chan_dahdi lock.
Richard Mudgett [Fri, 12 Mar 2010 19:05:40 +0000 (19:05 +0000)]
Doxegen this chan_dahdi lock.

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

10 years agoBecause ExecIf needs to reprocess arguments, it's best if we don't remove quotes...
Tilghman Lesher [Thu, 11 Mar 2010 21:07:07 +0000 (21:07 +0000)]
Because ExecIf needs to reprocess arguments, it's best if we don't remove quotes during parsing.

(closes issue #16905)
 Reported by: ip-rob
 Patches:
       20100303__issue16905.diff.txt uploaded by tilghman (license 14)
 Tested by: ip-rob

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

10 years agoFix tests on 32-bit systems.
Tilghman Lesher [Thu, 11 Mar 2010 20:29:19 +0000 (20:29 +0000)]
Fix tests on 32-bit systems.

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

10 years agoIf the argument to the system application is quoted, ensure we remove the quotes...
Tilghman Lesher [Thu, 11 Mar 2010 20:25:02 +0000 (20:25 +0000)]
If the argument to the system application is quoted, ensure we remove the quotes before trying to execute.

(closes issue #16842)
 Reported by: ip-rob
 Patches:
       20100310__issue16842.diff.txt uploaded by tilghman (license 14)
 Tested by: ip-rob

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

10 years agoMinor tweaks and comment updates to chan_dahdi.
Richard Mudgett [Thu, 11 Mar 2010 18:07:16 +0000 (18:07 +0000)]
Minor tweaks and comment updates to chan_dahdi.

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

10 years agoAdd supporting code for app-directory pause option.
Alec L Davis [Thu, 11 Mar 2010 07:03:51 +0000 (07:03 +0000)]
Add supporting code for app-directory pause option.

Since 1.6.1 CLI help reports that option p(n) 'initial pause' is available.
Supporting code was never implemented.

(closes issue #16751)
Reported by: alecdavis
Patches:
      directory_pause.trunk.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

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

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

10 years agoAdd new unit test for stringfields.
Jeff Peeler [Wed, 10 Mar 2010 23:15:55 +0000 (23:15 +0000)]
Add new unit test for stringfields.

(Copied from reviewboard)
Tests the following:
1. Basic allocation and setting of string fields.
2. Shrinking a string field and re-expanding it.
3. Growing the last allocation in a string field pool.
4. Setting a string to a large value such that a new string field pool must be
allocated.
In each part, we make sure that the string field is accurate (has the correct
value in it), make sure that the 2 bytes before the string field has the correct
capacity for the field, and for tests 2-4, we make sure that the string field is
where we expect it to be in memory.

Also tested:
5. Shrinking a string field and partially re-expanding it.
6. Setting strings in such a way as to create three separate string field pools
and then removing the middle pool.

There is a bug fix in the init function, which ensures the embedded_pool is set
to NULL which is important for stack allocated structures.

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

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

10 years agoHmmm, apparently needed to be fixed in trunk, too.
Tilghman Lesher [Wed, 10 Mar 2010 20:54:03 +0000 (20:54 +0000)]
Hmmm, apparently needed to be fixed in trunk, too.

(closes issue #16900)
 Reported by: bluecrow76
 Patches:
       asterisk-1.6.2.4-func_strings.diff uploaded by bluecrow76 (license 270)

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

10 years agoBe less ambiguous in Record() app docs.
Leif Madsen [Wed, 10 Mar 2010 20:53:43 +0000 (20:53 +0000)]
Be less ambiguous in Record() app docs.
For some reason the documentation for the 'k' application in trunk
and 1.6.2 is different than 1.6.0 and 1.6.1, so I'm setting them all
to match. The wording in 1.6.2 and trunk was ambiguous, so you could
interpret the wording the mean that recording would continue upon hangup
indefinitely, or you could interpret it to mean that the recorded
data would not be discarded upon hangup. This change makes it clear
we mean the latter, and not the former.

Came from a discussion in #asterisk on IRC.

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

10 years agoFix ParkAndAnnounce not respecting parking options.
Jeff Peeler [Wed, 10 Mar 2010 20:51:23 +0000 (20:51 +0000)]
Fix ParkAndAnnounce not respecting parking options.

The patch ensures that if a peer does not exist, parking settings are read from
the channel. A unit test has been written to ensure proper operation for both
standard parking and parking using masquerades.

(closes issue #16592)
Reported by: mwyres
Patches:
      bug_16592.diff uploaded by snuffy (license 35)

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

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

10 years agoIt's amazing what writing a test will find.
Tilghman Lesher [Wed, 10 Mar 2010 20:30:34 +0000 (20:30 +0000)]
It's amazing what writing a test will find.

(issue #16900)
 Reported by: bluecrow76

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

10 years agoFix jitterbuffer logging not creating logfiles.
Jeff Peeler [Wed, 10 Mar 2010 18:25:18 +0000 (18:25 +0000)]
Fix jitterbuffer logging not creating logfiles.

Three changes made here:
1) Do not fail if a previous log does not exist (in fact, this is probably
expected).
2) Ensure that the file descriptor to write to gets assigned properly. I am at
a loss as to why assigning safe_fd outside the if fixes this, but it makes
the if statement slightly less complicated anyway.
3) Move up the failure message so that the errno of the failure is not
overwritten by fclose.

(closes issue #16917)
Reported by: Artem

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

10 years agoSimplified dahdi_request() channel selection failed reason/cause code.
Richard Mudgett [Wed, 10 Mar 2010 16:55:34 +0000 (16:55 +0000)]
Simplified dahdi_request() channel selection failed reason/cause code.

Also avoid potential crash because cause could be NULL.

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

10 years agoReduce the amount of database access for HAVE_PRI_SERVICE_MESSAGES.
Richard Mudgett [Wed, 10 Mar 2010 03:16:50 +0000 (03:16 +0000)]
Reduce the amount of database access for HAVE_PRI_SERVICE_MESSAGES.

Rework HAVE_PRI_SERVICE_MESSAGES to not use the active values directly
from the database.  Database access is likely expensive.  Database access
now only happens on initialization, destruction, and when the B channel is
taken in or out of service.

This change is not related to call waiting but it would cause the search
for a call waiting interface to be very expensive and slow down D channel
message servicing.

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

10 years agoBuild system modifications to ensure that Asterisk properly builds on Mac OS X 10.6.
Tilghman Lesher [Tue, 9 Mar 2010 20:30:03 +0000 (20:30 +0000)]
Build system modifications to ensure that Asterisk properly builds on Mac OS X 10.6.

(closes issue #16997)
 Reported by: jquinn
 Patches:
       20100309__issue16997__2.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman, russell

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

10 years agoBlocked revisions 251410 via svnmerge
Sean Bright [Tue, 9 Mar 2010 19:31:00 +0000 (19:31 +0000)]
Blocked revisions 251410 via svnmerge

........
r251410 | seanbright | 2010-03-09 14:29:39 -0500 (Tue, 09 Mar 2010) | 8 lines

Use ast_strlen_zero to avoid a crash when a Dial() string isn't passed to ParkAndAnnounce

(closes issue #16731)
Reported by: sebele67
Patches:
      issue16731_20100129.diff uploaded by seanbright (license 71)
Tested by: sebele67

........

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

10 years agoMerged revisions 251309 via svnmerge from
Leif Madsen [Mon, 8 Mar 2010 18:08:44 +0000 (18:08 +0000)]
Merged revisions 251309 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r251309 | lmadsen | 2010-03-08 12:07:44 -0600 (Mon, 08 Mar 2010) | 13 lines

  Fix Debian init script to not use -c.
  When using the init script as-is currently, it could cause issues on Debian
  such as high CPU usage. This fix has worked for several people so I'm
  implementing the change.

  (closes issue #16784)
  Reported by: pabelanger
  Tested by: pabelanger, mnick, davidw, mutineer612

  (closes issue #16887)
  Reported by: jlpedrosa
  Tested by: jlpedrosa, mutineer612
........

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

10 years agoRemove portions that weren't meant to be committed for the OS X compat fix
Tilghman Lesher [Mon, 8 Mar 2010 05:15:01 +0000 (05:15 +0000)]
Remove portions that weren't meant to be committed for the OS X compat fix

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

10 years agoChange needed to make Mac OS X 10.6 happy
Tilghman Lesher [Mon, 8 Mar 2010 05:12:55 +0000 (05:12 +0000)]
Change needed to make Mac OS X 10.6 happy

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

10 years agoClean transmit_* for start/stop media transmission
Michiel van Baak [Sun, 7 Mar 2010 14:53:06 +0000 (14:53 +0000)]
Clean transmit_* for start/stop media transmission

Small patch changing skinny_set_rtp_peer to use transmit_stopmediatransmission and to use new transmit_startmediatransmission.
Basic testing on 30VIP's by wedhorn
Basic testing on 7960 by me

(closes issue #16956)
Reported by: wedhorn
Patches:
      skinny-clean05b.diff uploaded by wedhorn (license 30)
Tested by: wedhorn,mvanbaak

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

10 years agoCleanup transmit_callstate handling
Michiel van Baak [Sun, 7 Mar 2010 14:46:29 +0000 (14:46 +0000)]
Cleanup transmit_callstate handling

Broke the various functions included in transmit_callstate to their own functions. Transmit_callstate now just transmits callstate.

Generally left the functionality as it was, which highlight some minor code issues (eg multiple transmit_callstate's). I did however revise the hint code usage of the old transmit_callstate as it it not appropriate to put a device on hook based on the change of a hinted device.

(closes issue #16939)
Reported by: wedhorn
Patches:
      skinny-clean04.diff uploaded by wedhorn (license 30)
Tested by: mvanbaak,wedhorn

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

10 years agosmall log issue from bug 0016664
Alexandr Anikin [Sun, 7 Mar 2010 00:45:35 +0000 (00:45 +0000)]
small log issue from bug 0016664

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

10 years agoFix a crash in SIP blind transfer handling found by an automated external test.
Russell Bryant [Sat, 6 Mar 2010 14:16:20 +0000 (14:16 +0000)]
Fix a crash in SIP blind transfer handling found by an automated external test.

The first real test added to the external test suite found a pretty nasty crash
that occurred in Asterisk trunk.  The crash was due to a race condition between
the REFER handling and channel destruction in the channel thread.  After the
transfer has been completed, we go back to the transferrer channel and try to
lock it so we can fire off a CEL event.  However, there was no guarantee that
the channel was still around at that point since it's racing against the channel
thread.

Since ast_channel is a reference counted object, the fix is simple.  The code
unlocks the transferrer channel before finally completing the transfer with
an async goto.  At this point the channel thread is going to start call tear
down and the channel will eventually be destroyed.  To ensure that the channel
is valid when we want to fire off the CEL event, increase the channel's
reference count.

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

10 years agofixes xml error in func_pitchshift
David Vossel [Fri, 5 Mar 2010 21:51:25 +0000 (21:51 +0000)]
fixes xml error in func_pitchshift

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

10 years agoPITCH_SHIFT dialplan function
David Vossel [Fri, 5 Mar 2010 20:21:13 +0000 (20:21 +0000)]
PITCH_SHIFT dialplan function

The PITCH_SHIFT function can be used on a channel to independently
modify the pitch of both rx and tx audio streams.  Now you can
improve your conference calls by assigning a random pitch effect
to everyone entering a meetme room, or just make your day more
interesting by making your co-workers sound funny.  These are just
some of the numerious practical uses for this function. Enjoy!

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

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

10 years agoRemove pbx_gtkconsole and related gtk1 checks.
Russell Bryant [Fri, 5 Mar 2010 19:32:19 +0000 (19:32 +0000)]
Remove pbx_gtkconsole and related gtk1 checks.

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

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

10 years agoFix app_followme playing wrong sound files.
Jeff Peeler [Fri, 5 Mar 2010 19:10:47 +0000 (19:10 +0000)]
Fix app_followme playing wrong sound files.

Fixes regression introduced in 140167 that uses the wrong variable names.

(closes issue #16930)
Reported by: ianc
Patches:
      fix_reload_followme.diff uploaded by ianc (license 998)

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

10 years agoFix up some of chan_sip's usage of the RTP engine API.
Russell Bryant [Fri, 5 Mar 2010 05:03:41 +0000 (05:03 +0000)]
Fix up some of chan_sip's usage of the RTP engine API.

The get_local_address() function for an RTP instance was used when building an
SDP, but the results were not honored.  The RTP engine activate() function was
not being used once we have determined that media will now flow.

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

10 years agoMissing quote in ODBC query.
Tilghman Lesher [Fri, 5 Mar 2010 04:37:36 +0000 (04:37 +0000)]
Missing quote in ODBC query.

(closes issue #16953)
 Reported by: elguero
 Patches:
       app_voicemail-odbc-syntax-fix.diff uploaded by elguero (license 37)

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

10 years agoFix up the ast_rtp_property enum.
Russell Bryant [Fri, 5 Mar 2010 02:07:33 +0000 (02:07 +0000)]
Fix up the ast_rtp_property enum.

The mis-placement of the latest entry meant that when it was set, it was writing
one index past the end of the properties array in the ast_rtp_instance (which
happened to be the local_address field).

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

10 years agoMerged revisions 250786 via svnmerge from
Jeff Peeler [Fri, 5 Mar 2010 01:05:46 +0000 (01:05 +0000)]
Merged revisions 250786 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r250786 | jpeeler | 2010-03-04 19:02:58 -0600 (Thu, 04 Mar 2010) | 9 lines

  Fix not being able to specify a URL in MOH class directory.

  Don't attempt to chdir on a URL!

  (closes issue #16875)
  Reported by: raarts
  Patches:
        moh-http.patch uploaded by raarts (license 937)
........

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