asterisk/asterisk.git
10 years agoMake number not available presentation also set screening to network provided.
Richard Mudgett [Sat, 24 Mar 2012 00:40:51 +0000 (00:40 +0000)]
Make number not available presentation also set screening to network provided.

Q.951 indicates that when the presentation indicator is "Number not
available due to interworking" for a number then the screening indicator
field should be "Network provided".

* Made ast_party_id_presentation() return AST_PRES_NUMBER_NOT_AVAILABLE
when the presentation is "Number not available due to interworking".  This
fix makes Asterisk consistent and it also makes it consistent with earlier
branches as far as this presentation value is concerned.

* Made pri_to_ast_presentation() and ast_to_pri_presentation() conversions
handle the "Number not available due to interworking" case better in
sig_pri.c.  This change is possible because the minimum required libpri
version (v1.4.11) has the necessary defines in libpri.h.
........

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

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

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

10 years agoAdd missing initialization of update_redirecting in chan_sip.c
Richard Mudgett [Fri, 23 Mar 2012 22:56:14 +0000 (22:56 +0000)]
Add missing initialization of update_redirecting in chan_sip.c
........

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

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

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

11 years agoAdds F option to Bridge application
Jonathan Rose [Thu, 22 Mar 2012 21:25:22 +0000 (21:25 +0000)]
Adds F option to Bridge application

Similar to dial and queue F option.

(Closes issue ASTERISK-19282)
Reported by: To
Patches:
bridge_f-v3.diff uploaded by To (license 6347)
Review: https://reviewboard.asterisk.org/r/1825/

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

11 years agoKill off red blobs in most of main/*
Kinsey Moore [Thu, 22 Mar 2012 19:51:16 +0000 (19:51 +0000)]
Kill off red blobs in most of main/*

Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).

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

11 years agoUpdate install_prereq script to include missing GSM library for debian amd move SQLite3.
Jonathan Rose [Wed, 21 Mar 2012 14:55:27 +0000 (14:55 +0000)]
Update install_prereq script to include missing GSM library for debian amd move SQLite3.

(closes issue ASTERISK-19367)
Reported by: Andrew Latham
Patches:
debian_install_prereq.diff uploaded by Andrew Latham (license 5985)
........

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

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

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

11 years agoAlso detect gmime 2.6
Tzafrir Cohen [Wed, 21 Mar 2012 14:47:56 +0000 (14:47 +0000)]
Also detect gmime 2.6

Also detect gmime version 2.6 (Michael Biebl)

Signed-off-by: Tzafrir Cohen (License #5035) <tzafrir.cohen@xorcom.com>
........

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

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

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

11 years agoEnsure Asterisk sends a BYE when pending on the final response to a re-INVITE
Matthew Jordan [Wed, 21 Mar 2012 13:31:09 +0000 (13:31 +0000)]
Ensure Asterisk sends a BYE when pending on the final response to a re-INVITE

When Asterisk detects a hangup and cannot send a BYE due to a pending
INVITE, it sets the pendingbye flag and waits for the final response to that
INVITE.  When the response is received, it transmits the BYE.  If, however,
that INVITE request is a pending re-INVITE, it needs to first send a CANCEL
request to terminate the pending re-INVITE.  In that circumstance, Asterisk
was, in some scenarios, clearing the pendingbye flag after processing the
CANCEL request and not checking for a pending BYE when receiving the final
487 response to the INVITE.

This patch ensures that if the pendingbye flag is set, it is honored
regardless of the nature of the INVITE request currently in flight.

(closes issue ASTERISK-19365)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches:
  bugASTERISK-19365_2012_03_08.patch uploaded by mjordan (license 6283)

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

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

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

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

11 years agoPrevent Echo() from relaying control, null, and modem frames
Kinsey Moore [Tue, 20 Mar 2012 20:42:34 +0000 (20:42 +0000)]
Prevent Echo() from relaying control, null, and modem frames

Echo()'s description states that it echoes audio, video, and DTMF except for #
while it actually echoes any frame that it receives other than DTMF #.  This
was causing frame storms in the test suite in some circumstances where Echo()
was attached to both ends of a pair of local channels and control frames
were being periodically generated.  Echo()'s behavior and description have
been modifed so that it only echoes media and non-# DTMF frames.
........

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

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

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

11 years agochan_iax2: Correct spelling of 'Port' header in IAX2 PeerStatus AMI Events
Sean Bright [Tue, 20 Mar 2012 18:17:16 +0000 (18:17 +0000)]
chan_iax2: Correct spelling of 'Port' header in IAX2 PeerStatus AMI Events

The PeerStatus event for IAX2 channels currently includes a header named Post
which should have been Port.  Post was removed and the AMI version has been
updated to 1.3.
........

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

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

11 years agoAllow AMI action callback to be reentrant.
Richard Mudgett [Tue, 20 Mar 2012 17:31:28 +0000 (17:31 +0000)]
Allow AMI action callback to be reentrant.

Fix AMI module reload deadlock regression from ASTERISK-18479 when it
tried to fix the race between calling an AMI action callback and
unregistering that action.  Refixes ASTERISK-13784 broken by
ASTERISK-17785 change.

Locking the ao2 object guaranteed that there were no active callbacks that
mattered when ast_manager_unregister() was called.  Unfortunately, this
causes the deadlock situation.  The patch stops locking the ao2 object to
allow multiple threads to invoke the callback re-entrantly.  There is no
way to guarantee a module unload will not crash because of an active
callback.  The code attempts to minimize the chance with the registered
flag and the maximum 5 second delay before ast_manager_unregister()
returns.

The trunk version of the patch changes the API to fix the race condition
correctly to prevent the module code from unloading from memory while an
action callback is active.

* Don't hold the lock while calling the AMI action callback.

(closes issue ASTERISK-19487)
Reported by: Philippe Lindheimer

Review: https://reviewboard.asterisk.org/r/1818/
Review: https://reviewboard.asterisk.org/r/1820/
........

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

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

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

11 years agoConvert MuteAudio documentation to XML.
Richard Mudgett [Mon, 19 Mar 2012 20:26:51 +0000 (20:26 +0000)]
Convert MuteAudio documentation to XML.

* Added missing error exits with cause in manager_mutestream().

* Cleaned up manager_mutestream() and func_mute_write().

* Some whitespace and comment cleanup.

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

11 years agoPrevent chanspy from binding to zombie channels
Jonathan Rose [Fri, 16 Mar 2012 21:00:07 +0000 (21:00 +0000)]
Prevent chanspy from binding to zombie channels

This patch addresses a bug with chanspy on local channels which roughly 50% of the time
would create a situation where chanspy can latch onto a zombie channel, keeping the zombie
alive forever and causing the channel doing the spying to never be able to hang up.

(closes issue ASTERISK-19493)
Reported by: lvl
Review: https://reviewboard.asterisk.org/r/1819/
........

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

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

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

11 years agoSimplify some code in ast_app_run_sub().
Richard Mudgett [Fri, 16 Mar 2012 20:37:54 +0000 (20:37 +0000)]
Simplify some code in ast_app_run_sub().

* Remove unnnecessary const from const char * const var declaration in the
ast_app_run_macro() and ast_app_run_sub() prototypes.  The second const is
unnecessary.

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

11 years agoRevert the pre-dial addition.
Mark Michelson [Fri, 16 Mar 2012 15:38:45 +0000 (15:38 +0000)]
Revert the pre-dial addition.

The code may be just fine, but it had not received a "ship it!" on
review board yet.

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

11 years agoMissed lastinvite CSeq int to uint32_t change
Alec L Davis [Fri, 16 Mar 2012 08:27:14 +0000 (08:27 +0000)]
Missed lastinvite CSeq int to uint32_t change
from Review: https://reviewboard.asterisk.org/r/1699/
........

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

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

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

11 years agoFix warning from commit r359705 (predial options for app_dial)
Mark Murawki [Thu, 15 Mar 2012 20:11:55 +0000 (20:11 +0000)]
Fix warning from commit r359705 (predial options for app_dial)

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

11 years agoFix remotely exploitable stack overflow in HTTP manager
Matthew Jordan [Thu, 15 Mar 2012 19:11:03 +0000 (19:11 +0000)]
Fix remotely exploitable stack overflow in HTTP manager

There exists a remotely exploitable stack buffer overflow in HTTP digest
authentication handling in Asterisk.  The particular method in question
is only utilized by HTTP AMI.  When parsing the digest information, the
length of the string is not checked when it is copied into temporary buffers
allocated on the stack.

This patch fixes this behavior by parsing out pre-defined key/value pairs
and avoiding unnecessary copies to the stack.

(closes issue ASTERISK-19542)
Reported by: Russell Bryant
Tested by: Matt Jordan
........

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

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

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

11 years agoAdd options PreDial options 'b' and 'B' to app_dial
Mark Murawki [Thu, 15 Mar 2012 18:58:25 +0000 (18:58 +0000)]
Add options PreDial options 'b' and 'B' to app_dial

* Added 'b' and 'B' options to Dial.  These options will allow you to run
  last-minute dialplan on the caller and callee channels while the Dial
  application is executing, but before the call is started.  For example you
  can use the 'b' option to run dialplan on the callee channel to get the name
  of the newly created channel right away.

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

(closes issue: ASTERISK-19548)
Reported by: Mark Murawski
Tested by: Mark Murawski, Stefan Schmidt

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

11 years agoFix remotely exploitable stack overrun in Milliwatt
Matthew Jordan [Thu, 15 Mar 2012 18:55:54 +0000 (18:55 +0000)]
Fix remotely exploitable stack overrun in Milliwatt

Milliwatt is vulnerable to a remotely exploitable stack overrun when using
the 'o' option.  This occurs due to the milliwatt_generate function not
accounting for AST_FRIENDLY_OFFSET when calculating the maximum number of
samples it can put in the output buffer.

This patch resolves this issue by taking into account AST_FRIENDLY_OFFSET
when determining the maximum number of samples allowed.  Note that at no
point is remote code execution possible.  The data that is written into the
buffer is the pre-defined Milliwatt data, and not custom data.

(closes issue ASTERISK-19541)
Reported by: Russell Bryant
Tested by: Matt Jordan
Patches:
  milliwatt_stack_overrun.rev1.txt by Russell Bryant (license 6283)
  Note that this patch was written by Russell, even though Matt uploaded it
........

Merged revisions 359645 from http://svn.asterisk.org/svn/asterisk/branches/1.6.2
........

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

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

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

11 years agoRemove unused variable ‘srch’
Paul Belanger [Thu, 15 Mar 2012 18:34:39 +0000 (18:34 +0000)]
Remove unused variable ‘srch’

Missed on the previous commit

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

11 years agoAdd missing connected line macro calls to initial dial for Dial and Queue apps.
Richard Mudgett [Thu, 15 Mar 2012 18:32:22 +0000 (18:32 +0000)]
Add missing connected line macro calls to initial dial for Dial and Queue apps.

The connected line interception macros do not get executed when the
outgoing channel is initially created and that channel's caller-id is
implicitly imported into the incoming channel's connected line data.  If
you are using the interception macros, you would expect that they get run
for every change to a channel's connected line information outside of
normal dialplan execution.

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

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

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

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

11 years agoRemove some dead code found in _sip_show_peers()
Paul Belanger [Thu, 15 Mar 2012 17:36:15 +0000 (17:36 +0000)]
Remove some dead code found in _sip_show_peers()

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

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

11 years agochan_iax2: Fix use of uninitialized sockaddr_in in try_transfer().
Russell Bryant [Thu, 15 Mar 2012 00:54:32 +0000 (00:54 +0000)]
chan_iax2: Fix use of uninitialized sockaddr_in in try_transfer().

Initialize a struct sockaddr_in in try_transfer() so that the code isn't
(potentially) trying to read from it while uninitialized.
........

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

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

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

11 years agochan_gtalk: Fix potential use of uninitialized variable.
Russell Bryant [Thu, 15 Mar 2012 00:07:18 +0000 (00:07 +0000)]
chan_gtalk: Fix potential use of uninitialized variable.

Avoid potential use of idroster in gtalk_alloc() before it has been
initialized.
........

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

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

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

11 years agoapp_chanisavail: Fix use of uninitialized variable.
Russell Bryant [Wed, 14 Mar 2012 23:29:32 +0000 (23:29 +0000)]
app_chanisavail: Fix use of uninitialized variable.

Ensure that status is set before it is used by resetting it during each loop
iteration.  This could have resulted in incorrect results from this app.
........

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

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

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

11 years agoudptl: Ensure fec[] in udptl_build_packet() is initialized.
Russell Bryant [Wed, 14 Mar 2012 23:12:42 +0000 (23:12 +0000)]
udptl: Ensure fec[] in udptl_build_packet() is initialized.

Scan results indicated that this array could be used uninitialized.  At a quick
look, it looks correct.  In any case, initializing it is a Good Thing (tm).
........

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

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

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

11 years agoapp.h: Always initialize AST_DECLARE_APP_ARGS().
Russell Bryant [Wed, 14 Mar 2012 22:41:21 +0000 (22:41 +0000)]
app.h: Always initialize AST_DECLARE_APP_ARGS().

This patch ensures that the struct defined by AST_DECLARE_APP_ARGS() is always
fully initialized.  I'm not sure if this fixes any real bugs, but it silences
a bunch of warnings from coverity, and is generally a good thing to do anyway.
........

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

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

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

11 years agoFix deadlock potential with some ast_indicate/ast_indicate_data calls.
Richard Mudgett [Wed, 14 Mar 2012 22:38:29 +0000 (22:38 +0000)]
Fix deadlock potential with some ast_indicate/ast_indicate_data calls.

Calling ast_indicate()/ast_indicate_data() with the channel lock held can
result in a deadlock with a local channel because of how local channels
need to avoid deadlock.
........

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

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

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

11 years agoAdd tests for main/jitterbuf.c
Matthew Jordan [Wed, 14 Mar 2012 18:56:15 +0000 (18:56 +0000)]
Add tests for main/jitterbuf.c

This patch adds unit tests for main/jitterbuf.c.  This includes checking for
the following:
  * Nominal insertion and retrieval of frames
  * Insertion and retrieval of frames where the frames are inserted out of
    order with respect to the previous frame
  * Insertion and retrieval of frames where some number of frames that would
    occur in the expected sequence are instead dropped
  * Insertion and retrieval of frames with an arrival time that does not occur
    at the same rate as the surrounding frames
  * Resynchronization of the jitter buffer when an inserted frame breaks the
    resynchronization threshold
  * Overfilling of the jitter buffer

For each of the tests, both JB_TYPE_VOICE and JB_TYPE_CONTROL permutations
exist.

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

(issue: ASTERISK-18964)
Reported by: Kris Shaw
Tested by: Kris Shaw, Matt Jordan

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

11 years agoThree copies of the file contents in channel_internal.h are a bit excessive.
Richard Mudgett [Wed, 14 Mar 2012 18:12:08 +0000 (18:12 +0000)]
Three copies of the file contents in channel_internal.h are a bit excessive.

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

11 years agoFix incorrect jitter buffer overflow due to missed resynchronizations
Matthew Jordan [Wed, 14 Mar 2012 17:48:40 +0000 (17:48 +0000)]
Fix incorrect jitter buffer overflow due to missed resynchronizations

When a change in time occurs, such that the timestamps associated with frames
being placed into an adaptive jitter buffer (implemented in jitterbuf.c)
are significantly different then the previously inserted frames, the jitter
buffer checks to see if it needs to be resynched to the new time frame.  If
three consecutive packets break the threshold, the jitter buffer resynchs
itself to the new timestamps.  This currently only occurs when history is
calculated, and hence only on JB_TYPE_VOICE frames.

JB_TYPE_CONTROL frames, on the other hand, are never passed to the history
calculations.  Because of this, if the jump in time is greater then the
maximum allowed length of the jitter buffer, the JB_TYPE_CONTROL frames are
dropped and no resynchronization occurs.  Alterntively, if the overfill
logic is not triggered, the JB_TYPE_CONTROL frame will be placed into the
buffer, but with a time reference that is not applicable.  Subsequent
JB_TYPE_VOICE frames will quickly trigger the overflow logic until reads
from the jitter buffer reach the errant JB_TYPE_CONTROL frame.

This patch allows JB_TYPE_CONTROL frames to resynch the jitter buffer.  As
JB_TYPE_CONTROL frames are unlikely to occur in multiples, it perform the
resynchronization on any JB_TYPE_CONTROL frame that breaks the resynch
threshold.

Note that this only impacts chan_iax2, as other consumers of the adaptive
jitter buffer use the abstract jitter buffer API, which does not use
JB_TYPE_CONTROL frames.

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

(closes issue ASTERISK-18964)
Reported by: Kris Shaw
Tested by: Kris Shaw, Matt Jordan
Patches:
  jitterbuffer-2012-2-26.diff uploaded by Kris Shaw (license 5722)
........

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

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

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

11 years agoFix Dial m and r options and forked calls generating warnings for voice frames.
Richard Mudgett [Wed, 14 Mar 2012 17:39:45 +0000 (17:39 +0000)]
Fix Dial m and r options and forked calls generating warnings for voice frames.

When connected line support was added, the wait_for_answer() variable
single changed its meaning slightly.  Unfortunately, the places where
single was used did not necessarily get updated to reflect that change.
Also audio/video frames were sent to all forked calls when the endpoints
were never made compatible.

* Don't pass audio/video media frames when the channels have not been made
compatible.

* Added handling of AST_CONTROL_SRCCHANGE to app_dial.c.

* Fixed app_dial.c passing on AST_CONTROL_HOLD because that frame can also
pass a requested MOH class.

(closes issue ASTERISK-16901)
Reported by: Chris Gentle

(closes issue ASTERISK-17541)
Reported by: clint

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

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

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

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

11 years agoForce non-inlining of ao2_iterator_destroy when TEST_FRAMEWORK is enabled
Matthew Jordan [Wed, 14 Mar 2012 14:40:44 +0000 (14:40 +0000)]
Force non-inlining of ao2_iterator_destroy when TEST_FRAMEWORK is enabled

In r357272, astobj2 was changed to automatically enable REF_DEBUG when the
TEST_FRAMEWORK flag was enabled.  Unfortunately, some compilers (gcc 4.5.1
at least) will attempt to inline ao2_iterator_destroy in handle_astobj2_test.
This by itself is not a problem; unfortunately, the compiler believes that
there is a code path wherein an object allocated on the stack will be
free'd.  As warnings are treated as errors, this prevents compilation of
astobj2.

This patch works around that by adding the noinline attribue to
ao2_iterator_destroy, but only if the TEST_FRAMEWORK flag is enabled.
Preventing inlining is only needed for the test method defined in astobj2,
which is also only enabled if TEST_FRAMEWORK is enabled.

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

11 years agoFix bogus reads/writes of console log levels in asterisk.c
Russell Bryant [Wed, 14 Mar 2012 10:56:53 +0000 (10:56 +0000)]
Fix bogus reads/writes of console log levels in asterisk.c

This patch updates the NUMLOGLEVELS define in logger.h to 32, to match the fact
that logger.c implements 32 log levels (because of the custom log level stuff).
asterisk.c uses this define to size an array of levels per remote console.

This array is modified in ast_console_toggle_loglevel(), which is called by the
"logger set level" CLI command.  While the documentation for the CLI command
doesn't make it terribly obvious, you can use this CLI command to toggle a
custom log level on a remote console, as well.  However, doing so led to an
invalid array index in asterisk.c.

This array is read from any time a log message is written to a console.  So,
all custom log level messages resulted in a bogus read if a remote console
was connected.
........

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

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

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

11 years agoFix invalid reads/writes due to incorrect sizeof().
Russell Bryant [Wed, 14 Mar 2012 10:05:07 +0000 (10:05 +0000)]
Fix invalid reads/writes due to incorrect sizeof().

These few places in the code used sizeof() on h_addr in struct hostent.
This is sizeof(char *).  The correct way to get the size of this address is to
use h_length.  This error would result in reads/writes of 8 bytes instead of 4
on 64-bit machines.
........

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

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

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

11 years agoFix inaccurate sizeof() in sched.c.
Russell Bryant [Wed, 14 Mar 2012 01:35:30 +0000 (01:35 +0000)]
Fix inaccurate sizeof() in sched.c.

This code just needed sizeof(int), not sizeof(int *).
........

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

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

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

11 years agoFix incorrect sizeof() in astman.
Russell Bryant [Wed, 14 Mar 2012 00:45:02 +0000 (00:45 +0000)]
Fix incorrect sizeof() in astman.
........

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

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

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

11 years agoFix incorrect usage of sizeof() in res_crypto.
Russell Bryant [Wed, 14 Mar 2012 00:39:23 +0000 (00:39 +0000)]
Fix incorrect usage of sizeof() in res_crypto.

In this case, just remove the memset().  There was a redundant memset that is
done correctly just 2 lines later.
........

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

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

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

11 years agoFix broken usage of sizeof() in res_adsi.
Russell Bryant [Wed, 14 Mar 2012 00:29:47 +0000 (00:29 +0000)]
Fix broken usage of sizeof() in res_adsi.
........

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

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

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

11 years agoFix incorrect sizeof() usage in features.c.
Russell Bryant [Wed, 14 Mar 2012 00:22:10 +0000 (00:22 +0000)]
Fix incorrect sizeof() usage in features.c.

This didn't actually result in a bug anywhere, luckily.  The only place
where the result of these memcpys was used is in app_dial, and the only
field that it read out of ast_call_feature was the first one, which is an
int, so these memcpys always copied just enough to avoid a problem.
........

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

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

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

11 years agoFix incorrect sizeof() on a pointer in MD5Final().
Russell Bryant [Wed, 14 Mar 2012 00:10:37 +0000 (00:10 +0000)]
Fix incorrect sizeof() on a pointer in MD5Final().
........

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

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

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

11 years agoDon't use a buffer after it goes out of scope.
Russell Bryant [Wed, 14 Mar 2012 00:01:40 +0000 (00:01 +0000)]
Don't use a buffer after it goes out of scope.

's' is set to 'workspace'.  Make sure 'workspace' doesn't go out of scope while
the reference to it via 's' is still used.
........

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

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

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

11 years agoBlocked revisions 359054
Russell Bryant [Tue, 13 Mar 2012 23:46:55 +0000 (23:46 +0000)]
Blocked revisions 359054

........
Dump cache of published events when a node joins the cluster.

Also use a more reliable method for stopping the poll() thread.
........

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

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

11 years agoRemove chan_usbradio and app_rpt.
Russell Bryant [Tue, 13 Mar 2012 23:42:24 +0000 (23:42 +0000)]
Remove chan_usbradio and app_rpt.

These modules are being maintained outside of the tree and have been for a long
time now, so it doesn't make sense to keep them here.

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

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

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

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

11 years agoAdd missing channel_internal.h
Terry Wilson [Tue, 13 Mar 2012 21:24:13 +0000 (21:24 +0000)]
Add missing channel_internal.h

...again.

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

11 years agoAdd ability for chan_dahdi ISDN to block connected line updates per span.
Richard Mudgett [Tue, 13 Mar 2012 21:18:31 +0000 (21:18 +0000)]
Add ability for chan_dahdi ISDN to block connected line updates per span.

Added new chan_dahdi.conf colp_send option parameter to block connected
line updates per span.

(closes issue ASTERISK-17025)
Reported by: Michael Smith

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

11 years agoFix setting CDR variables in the hangup extension
Terry Wilson [Tue, 13 Mar 2012 20:43:19 +0000 (20:43 +0000)]
Fix setting CDR variables in the hangup extension

A previous CDR fix for setting CDR variables during a bridge via
custom dialplan features broke setting CDR variables in the
hangup extension. This patch fixes the issue.

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

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

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

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

11 years agoMake hints for invalid SIP devices return Unavail, not idle
Terry Wilson [Tue, 13 Mar 2012 20:06:57 +0000 (20:06 +0000)]
Make hints for invalid SIP devices return Unavail, not idle

This patch drastically simplifies the device state aggegation code.
The old method was not only overly complex, but also made it impossible
to return AST_DEVICE_INVALID from the aggregation code. The unit test
update is as a result of fixing that bug.

The SIP change stems from a bug introduced by removing a DNS lookup
for hostname-based SIP channels.

(closes issue ASTERISK-16702)
Review: https://reviewboard.asterisk.org/r/1808/
........

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

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

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

11 years agoFix IMAP storage compilation after opaquification changes
Terry Wilson [Tue, 13 Mar 2012 18:55:14 +0000 (18:55 +0000)]
Fix IMAP storage compilation after opaquification changes

(closes issue ASTERISK-19513)

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

11 years agoFinalize ast_channel opaquification
Terry Wilson [Tue, 13 Mar 2012 18:20:34 +0000 (18:20 +0000)]
Finalize ast_channel opaquification

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

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

11 years agoFix crash caused by opaquification change -r356042.
Richard Mudgett [Tue, 13 Mar 2012 17:01:55 +0000 (17:01 +0000)]
Fix crash caused by opaquification change -r356042.

The set_format() function was more subtle in how it modified the
struct ast_channel readtrans/writetrans values.

* Fixed ast_activate_generator() conversion correctly.

(closes issue ASTERISK-19434)
Reported by: Birger Harzenetter
Tested by: rmudgett

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

11 years agoUse struct copy instead of memcpy().
Richard Mudgett [Tue, 13 Mar 2012 16:50:06 +0000 (16:50 +0000)]
Use struct copy instead of memcpy().

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

11 years agoEnable macros in 1.8 to find the next highest "h" extension in a context, like in...
Tilghman Lesher [Tue, 13 Mar 2012 08:06:20 +0000 (08:06 +0000)]
Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4.

This change restores functionality that was present in 1.4, when AEL macros
were implemented with the Macro dialplan application.  Macros are fraught with
functionality issues, because they consume a large portion of the underlying
application stack.  This limits the ability of AEL users to call many layers
of subroutines, an issue which Gosub does not have (originally tested to
100,000 levels deep).  Therefore, starting in 1.6.0, AEL macros were
implemented with Gosub.

However, there were some implicit behaviors of Macro, which were not replicated
at the same time as with the transition to Gosub, one of which is documented in
the related issue.  In particular, the "h" extension is designed to execute not
in the Macro context, but in the topmost calling context.  Due to legacy issues
with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks
in all calling contexts, bubbling up from the deepest level until it finds an
"h" extension.

Since AEL hides the complexity of the underlying dialplan logic from the AEL
programmer, it's reasonable to assume that this behavior should not change in
the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break
working AEL configurations in the transition to Asterisk 1.8 LTS.  This fix
is the result, which implements a search for the "h" extension in all calling
Gosub contexts.

Fixes ASTERISK-19336

Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher
(with slight modifications for 1.8)

Tested by: Johan Wilfer

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

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

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

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

11 years agoMassive changes in chan_unistim channel driver. Include many fixes in channel driver...
Igor Goncharovskiy [Mon, 12 Mar 2012 17:01:26 +0000 (17:01 +0000)]
Massive changes in chan_unistim channel driver. Include many fixes in channel driver operation and add additional functionality:
 * Added ability to use multiple lines on phone, so for one device in configuration multiple lines can be defined, it allows to have multiple calls on one phone, callwaiting and switching between calls.
 * Added ability for translation on-screen menu to multiple languages. Tested on Russian languages.  Supported encodings: ISO 8859-1, ISO 8859-2, ISO 8859-4, ISO 8859-5, ISO 2022-JP. Language controlled by 'language' and on-screen menu of phone
 * Other described in CHANGES file

Testing done by issue tracker users: ibercom, scsiborg, idarwin, TeknoJuce, c0rnoTa.
Tested on production system by Jonn Taylor (jonnt) using phone models: Nortel i2004, 1120E and 1140E.

(closes issue ASTERISK-16890)

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

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

11 years agoTransition app_page to using app_confbridge internally for the conference bridge...
Joshua Colp [Sat, 10 Mar 2012 20:06:46 +0000 (20:06 +0000)]
Transition app_page to using app_confbridge internally for the conference bridge portion of paging. This also adds a new 'announcement' option to ConfBridge user profiles.

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

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

11 years agoResolve a few more cases of variable shadowing.
Sean Bright [Thu, 8 Mar 2012 17:48:14 +0000 (17:48 +0000)]
Resolve a few more cases of variable shadowing.

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

11 years agoEliminate a bunch of shadow warnings.
Sean Bright [Thu, 8 Mar 2012 17:02:52 +0000 (17:02 +0000)]
Eliminate a bunch of shadow warnings.

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

11 years agoAdd some underscores in a few of our llist macros to reduce name collisions.
Sean Bright [Thu, 8 Mar 2012 17:00:22 +0000 (17:00 +0000)]
Add some underscores in a few of our llist macros to reduce name collisions.

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

11 years agoMake transfer not ignore port information with SIP.
Jonathan Rose [Thu, 8 Mar 2012 16:59:30 +0000 (16:59 +0000)]
Make transfer not ignore port information with SIP.

Attempting to transfer with SIP to an address like 1XXXXX@ip.ad.re.ss:5061 would fail
because port would be cut from the host string and ignored. This simply keeps chan_sip
from cutting off the port number during these kinds of transfers.

(closes issue ASTERISK-19321)
Reported by: Federico Alves
Review: https://reviewboard.asterisk.org/r/1790/diff/#index_header
........

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

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

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

11 years agoAdd --enable-dev-mode=strict to configure.
Sean Bright [Thu, 8 Mar 2012 16:21:49 +0000 (16:21 +0000)]
Add --enable-dev-mode=strict to configure.

Passing -Wshadow to gcc enables shadow warnings.  From the gcc manual:

    Warn whenever a local variable or type declaration shadows another
    variable, parameter, type, or class member (in C++), or whenever a
    built-in function is shadowed.

Asterisk will not currently compile with this option set, but a number of bugs
have been discovered by enabling this flag on specific files.  The long-term
goal is to eliminate all of the suspect code that causes this warning to be
emitted.

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

11 years agoWhitespace only change to the Makefile
Sean Bright [Thu, 8 Mar 2012 16:12:11 +0000 (16:12 +0000)]
Whitespace only change to the Makefile

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

11 years agoHandle numeric columns for eventtype properly in cel_odbc
Terry Wilson [Wed, 7 Mar 2012 21:28:55 +0000 (21:28 +0000)]
Handle numeric columns for eventtype properly in cel_odbc

Patch also implements correct handling of datetime2 and datetimeoffset new
datatypes in SQL Server 2008 and 2008 R2.

(closes issue ASTERISK-17548)

Review: https://reviewboard.asterisk.org/r/1160/
Review: https://reviewboard.asterisk.org/r/1804/

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

11 years agoChange directly setting _softhangup in sig_ss7.c to use ast_softhangup_nolock().
Richard Mudgett [Wed, 7 Mar 2012 18:33:12 +0000 (18:33 +0000)]
Change directly setting _softhangup in sig_ss7.c to use ast_softhangup_nolock().

Update to:
(issue ASTERISK-19372)
........

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

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

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

11 years agoReturn g729 and g723.1 frames with the number of samples set properly.
Sean Bright [Wed, 7 Mar 2012 16:16:03 +0000 (16:16 +0000)]
Return g729 and g723.1 frames with the number of samples set properly.

If the wctc4xxp returns more than a single packet, we need to update the number
of samples in the returned frame accordingly.

Acked-by: Shaun Ruffell <sruffell@digium.com>
........

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

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

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

11 years agoSet snarkiness = 0 in cdr_adaptive_odbc.conf.sample
Terry Wilson [Wed, 7 Mar 2012 15:19:05 +0000 (15:19 +0000)]
Set snarkiness = 0 in cdr_adaptive_odbc.conf.sample
........

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

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

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

11 years agoAdd detection for ODBC WCHAR fields
Terry Wilson [Wed, 7 Mar 2012 15:08:08 +0000 (15:08 +0000)]
Add detection for ODBC WCHAR fields

Without detecting these types, cel_odbc blows up when the character
set for the table is utf8. This also wraps cdr_adaptive_odbc's use of
those types in the HAVE_ODBC_WCHAR #ifdef seen in other parts of the
code.
........

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

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

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

11 years agoFix ring cadance setup for outgoing calls on FXS ports.
Richard Mudgett [Tue, 6 Mar 2012 17:47:40 +0000 (17:47 +0000)]
Fix ring cadance setup for outgoing calls on FXS ports.

* Fix referencing the wrong variable in chan_dahdi.c:my_set_cadence().

Thanks to Sean Bright for compiling with -Wshadow and finding this bug.
........

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

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

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

11 years agoAdd dialtone_detect option for analog incoming calls.
Richard Mudgett [Tue, 6 Mar 2012 01:56:10 +0000 (01:56 +0000)]
Add dialtone_detect option for analog incoming calls.

For analog lines, enables Asterisk to use dialtone detection per channel
if an incoming call was hung up before it was answered.  If dialtone is
detected, the call is hung up.
no:       Disabled. (Default)
yes:      Look for dialtone for 10000 ms after answer.
<number>: Look for dialtone for the specified number of ms after answer.
always:   Look for dialtone for the entire call.  Dialtone may return
          if the far end hangs up first.

dialtone_detect=yes
dialtone_detect=5000
dialtone_detect=always

(closes issue ASTERISK-19316)
Reported by: Jeremy Pepper
Patch by: Jeremy Pepper
Tested by: rmudgett,Jeremy Pepper

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

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

11 years agoDrop SS7 call if not connected yet when INCOMPLETE/BUSY/CONGESTION.
Richard Mudgett [Mon, 5 Mar 2012 22:32:48 +0000 (22:32 +0000)]
Drop SS7 call if not connected yet when INCOMPLETE/BUSY/CONGESTION.

SS7 is a trunk protocol and should clear a failed call as soon as
possible.

* Made SS7 hangup a call immediately if it has not connected yet for
INCOMPLETE/BUSY/CONGESTION causes.  Otherwise, play an appropriate inband
tone.

(closes issue ASTERISK-19372)
Reported by: Igor Nikolaev
........

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

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

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

11 years agoMake usage of DECLARE_STRINGFIELD_SETTERS_FOR() not look so odd.
Richard Mudgett [Mon, 5 Mar 2012 21:55:28 +0000 (21:55 +0000)]
Make usage of DECLARE_STRINGFIELD_SETTERS_FOR() not look so odd.

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

11 years agoSetup DSP when SS7 call is connected or early media is available.
Richard Mudgett [Mon, 5 Mar 2012 21:48:32 +0000 (21:48 +0000)]
Setup DSP when SS7 call is connected or early media is available.

Outgoing SS7 calls fail to detect incoming DTMF so any bridged channel
that requires out-of-band DTMF will not work.

* Added sig_ss7_open_media() calls at appropriate places in sig_ss7.c.
The new call converts conditionaled out unconverted code and shows that
the code really did something useful.

* Improved some chan_dahdi DTMF debug messages to help track DTMF
handling.

(closes issue ASTERISK-19312)
Reported by: Igor Nikolaev
........

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

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

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

11 years agoEliminate double close of file descriptor in manager.c
Jonathan Rose [Mon, 5 Mar 2012 19:06:46 +0000 (19:06 +0000)]
Eliminate double close of file descriptor in manager.c

The process_output function in manager.c attempted to call fclose and close immediately
afterwards. Since fclose implies close, this resulted in a potential double free on file
descriptors. This patch changes that behavior and also adds error checking to fclose and
close depending on which was deemed necessary. Also error messages. Thanks to Rosen
Iliev for pointing out the location of the problem.

(closes issue ASTERISK-18453)
Reported By: Jaco Kroon
Review: https://reviewboard.asterisk.org/r/1793/
........

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

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

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

11 years agoDefer sending the connected line reinvite if a reinvite is already in progress.
Joshua Colp [Mon, 5 Mar 2012 16:44:16 +0000 (16:44 +0000)]
Defer sending the connected line reinvite if a reinvite is already in progress.

(issue ASTERISK-19355)
Reported by: tomaso

(closes issue AST-825)
........

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

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

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

11 years agoEnsure Asterisk acknowledges ACKs to 4xx on Replaces errors
Kinsey Moore [Mon, 5 Mar 2012 16:00:32 +0000 (16:00 +0000)]
Ensure Asterisk acknowledges ACKs to 4xx on Replaces errors

Asterisk was not setting pendinginvite in the upper half of
handle_request_invite such that the 4xx was retransmitted repeatedly even
though an ack was received for every retransmission.

(closes issue ASTERISK-19303)
Reported by: Jon Tsiros
Patches:
  fix-19303.patch uploaded by Jeremiah Gowdy (license 6358)

........

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

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

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

11 years agoTab to spaces and text change.
Sean Bright [Mon, 5 Mar 2012 11:20:00 +0000 (11:20 +0000)]
Tab to spaces and text change.

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

11 years agoFix unused-but-set-variable warnings
Terry Wilson [Fri, 2 Mar 2012 23:29:53 +0000 (23:29 +0000)]
Fix unused-but-set-variable warnings

All of these were pretty obviously unused. Some were unused because
the code that used them was #if 0'd. In those cases, I just commented
out the unused-but-set variables.
........

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

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

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

11 years agoCorrect some set-but-unused variable warnings in the mISDN library.
Terry Wilson [Fri, 2 Mar 2012 23:25:10 +0000 (23:25 +0000)]
Correct some set-but-unused variable warnings in the mISDN library.

(from kpfleming's commit to trunk r356292)
........

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

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

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

11 years agoMake chan_usbradio compile under dev mode
Terry Wilson [Fri, 2 Mar 2012 22:36:28 +0000 (22:36 +0000)]
Make chan_usbradio compile under dev mode

x=++x and x=x=1? Really?
........

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

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

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

11 years agoFix case-sensitivity for device-specific event subscriptions and CCSS
Kinsey Moore [Fri, 2 Mar 2012 21:06:12 +0000 (21:06 +0000)]
Fix case-sensitivity for device-specific event subscriptions and CCSS

This change fixes case-sensitivity for device-specific subscriptions such that
the technology identifier is case-insensitive while the remainder of the device
string is still case-sensitive.  This should also preserve the original case of
the device string as passed in to the event system.  CCSS is the only feature
affected as it is the only consumer of device-specific event subscriptions.

The second part of this patch addresses similar case-sensitivity issues within
CCSS itself that prevented it from functioning correctly after the fix to the
events system.

This adds a unit test to verify that the event system works as expected.

(closes issue ASTERISK-19422)
Review: https://reviewboard.asterisk.org/r/1780/
........

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

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

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

11 years agoRemove ISDN hold restriction for non-bridged calls.
Richard Mudgett [Fri, 2 Mar 2012 18:38:49 +0000 (18:38 +0000)]
Remove ISDN hold restriction for non-bridged calls.

The check if an ISDN call is bridged before it could be placed on hold is
not necessary and is overly restrictive.  The check was originally done to
prevent problems with call transfers in case a user tried to transfer a
call connected to an application to another call connected to an
application.  The ISDN transfer code has not required this restriction for
quite some time because ECT could transfer any two active calls to each
other.

* Remove ISDN hold restriction for calls connected to applications.

* Made ast_waitfordigit_full() ignore AST_CONTROL_HOLD and
AST_CONTROL_UNHOLD instead of generating a warning message.

(closes issue ASTERISK-19388)
Reported by: Birger Harzenetter
Tested by: rmudgett
........

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

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

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

11 years agoAdds a transfer callee on hangup option (like with Dial option F) to queues.
Jonathan Rose [Fri, 2 Mar 2012 16:57:12 +0000 (16:57 +0000)]
Adds a transfer callee on hangup option (like with Dial option F) to queues.

This should (and does in my testing) act just like the Dial option of the same name.
This allows a queue member to be transfered to the next priority (no args), or to
a context/extension/priority similar to goto (with args context^extension^priority)
when a caller hangs up on them.

(closes issue ASTERISK-19283)
Reported by: To
Patches:
queue_f-v3.diff uploaded by To (license 6347)
Review: https://reviewboard.asterisk.org/r/1785/

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

11 years agoRemove bad usage of goto in ChanSpy next_channel().
Richard Mudgett [Fri, 2 Mar 2012 16:26:01 +0000 (16:26 +0000)]
Remove bad usage of goto in ChanSpy next_channel().

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

11 years agoBeef up the IAX2 sample configuration a bit and fix some formatting issues.
Sean Bright [Fri, 2 Mar 2012 16:19:53 +0000 (16:19 +0000)]
Beef up the IAX2 sample configuration a bit and fix some formatting issues.

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

11 years agoFix channel reference leak in ChanSpy.
Richard Mudgett [Fri, 2 Mar 2012 16:03:38 +0000 (16:03 +0000)]
Fix channel reference leak in ChanSpy.

* Fix next_channel() channel reference leak in ChanSpy.

(closes issue ASTERISK-19461)
Reported by: Irontec
Patches:
      app_chanspy_iteartor_next_unref.patch (license #6213) patch uploaded by Irontec

(issue ASTERISK-17515)
........

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

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

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

11 years agoFix compile error from latest channel opaquification change.
Richard Mudgett [Fri, 2 Mar 2012 16:01:05 +0000 (16:01 +0000)]
Fix compile error from latest channel opaquification change.

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

11 years agoThe default value for mohinterpret is the empty string, so when resetting to
Sean Bright [Fri, 2 Mar 2012 16:00:41 +0000 (16:00 +0000)]
The default value for mohinterpret is the empty string, so when resetting to
default values don't explicitly set the value to "default."
........

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

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

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

11 years agoFix race condition that can cause important control frames (such as a hangup) to...
Mark Michelson [Fri, 2 Mar 2012 01:33:06 +0000 (01:33 +0000)]
Fix race condition that can cause important control frames (such as a hangup) to be missed.

This takes two actions.

1. Move the reading of the alertpipe in __ast_read() to immediately before the
removal of frames from the readq. This means we won't do something silly like
read from the alertpipe, then ignore the fact that there's a frame to get from
the readq since channel's fdno is the AST_TIMING_FD.

2. When ast_settimeout() sets the rate to 0 and the timingfunc to NULL, if the
channel's fdno is the AST_TIMING_FD, then set the fdno to -1. This is because
if the rate is 0 and the timingfunc is NULL, it means that the channel's timing
fd is being invalidated, so any pending reads should not occur.

This may actually solve more issues than the referenced one below, but it's not
known at this time for sure.

(closes issue ASTERISK-19223)
reported by Frank-Michael Wittig

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

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

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

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

11 years agoFix compilation error due to typo during channel opaquification.
Mark Michelson [Fri, 2 Mar 2012 01:25:36 +0000 (01:25 +0000)]
Fix compilation error due to typo during channel opaquification.

s/ast_channel_fd_set/ast_channel_internal_fd_set/g

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

11 years agoOpaquify ast_channel typedefs, fd arrays, and softhangup flag
Terry Wilson [Thu, 1 Mar 2012 22:09:18 +0000 (22:09 +0000)]
Opaquify ast_channel typedefs, fd arrays, and softhangup flag

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

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

11 years agoPrevent outbound SIP NOTIFY packets from displaying a port of 0
Kinsey Moore [Thu, 1 Mar 2012 14:22:01 +0000 (14:22 +0000)]
Prevent outbound SIP NOTIFY packets from displaying a port of 0

In the change from 1.6.2 to 1.8, ast_sockaddr was introduced which changed the
behavior of ast_find_ourip such that port number was wiped out.  This caused
the port in internip (which is used for Contact and Call-ID on NOTIFYs) to be
0.  This change causes ast_find_ourip to be port-preserving again.

(closes issue ASTERISK-19430)
........

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

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

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

11 years agoUpdate stringfield documentation for removed second va_list in favor of va_copy.
Walter Doekes [Wed, 29 Feb 2012 20:41:38 +0000 (20:41 +0000)]
Update stringfield documentation for removed second va_list in favor of va_copy.

In r320946, the second va_list that was passed to ast_string_field_build_va
and friends, was removed. This patch updates the documentation to reflect that.
........

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

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

11 years agoAdd IPv6 support to FastAGI.
Sean Bright [Wed, 29 Feb 2012 20:31:48 +0000 (20:31 +0000)]
Add IPv6 support to FastAGI.

Review: https://reviewboard.asterisk.org/r/1774/
Reviewed by: Simon Perreault, Mark Michelson

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

11 years agoFix copying of CDR(accountcode) to local channels.
Walter Doekes [Wed, 29 Feb 2012 19:48:33 +0000 (19:48 +0000)]
Fix copying of CDR(accountcode) to local channels.

In r203638, during the addition of the Channel Event Logging, in mid-2009, this
got broken in trunk and ended up in asterisk 1.8 and higher. This fixes so the
CDR(accountcode) from the calling channel is available to dialed channels again
as well as showing up properly in the CDR's.

(closes issue ASTERISK-19384)
Reported by: jamicque
Patches: accountcode.patch (License #6033) by jamicque
Review: https://reviewboard.asterisk.org/r/1775/
Reviewed by: Richard Mudgett
........

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

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

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

11 years agoOpaquify ast_channel structs and lists
Terry Wilson [Wed, 29 Feb 2012 16:52:47 +0000 (16:52 +0000)]
Opaquify ast_channel structs and lists

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

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

11 years agoAdding transport=udp to sample sip.conf - Also changes version of Asterisk 1.8 in...
Jonathan Rose [Tue, 28 Feb 2012 22:31:24 +0000 (22:31 +0000)]
Adding transport=udp to sample sip.conf - Also changes version of Asterisk 1.8 in UPGRADE

(issue ASTERISK-19352)
Reported by: jamicque
Patches:
asterisk-19352-transport-warning-message-v1.patch uploaded by Michael L. Young (license 5026)
........

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

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

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

11 years agoAdd additional character type types to supported data types for cdr_adaptive_odbc
Jonathan Rose [Tue, 28 Feb 2012 22:01:45 +0000 (22:01 +0000)]
Add additional character type types to supported data types for cdr_adaptive_odbc

The reporter was uable to use varchar utf8_unicode_ci with cdr_adaptive_odbc, so
this patch adds those along with some other character types to the list of types
cdr_adaptive_odbc will work using the varchar conditions. The problem wasn't really
UTF8 characters as much as it was a failure to respond to the exact type that was
declared/in use on that database.

(closes issue ASTERISK-19334)
Reported By: Igor Nikolaev
Patches:
cdr_adaptive_odbc.patch uploaded by Igor Nikolaev (license 6236)
........

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

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

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

11 years agoCorrectly reset the dialplan priority.
Tilghman Lesher [Tue, 28 Feb 2012 21:26:34 +0000 (21:26 +0000)]
Correctly reset the dialplan priority.

When the stack frame is allocated, we save the address to which we should
return, when the Gosub returns.  However, if we just want to restore the
priority, then we need to subtract 1 before setting it.  Otherwise, when
a Gosub goes to a nonexistent address, it will skip a priority in the
dialplan.  This is because when we return from an application, the PBX
increments the priority for us.
........

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

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

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

11 years agoUse more reasonable cause code when rejecting incoming call waiting calls.
Richard Mudgett [Tue, 28 Feb 2012 21:01:09 +0000 (21:01 +0000)]
Use more reasonable cause code when rejecting incoming call waiting calls.

(closes issue ASTERISK-19397)
Reported by: Birger Harzenetter
Patches:
      nochannel-cause.patch (license #5870) patch uploaded by Birger Harzenetter
........

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

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

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

11 years agorevision 357386 -- oops, accidentally made it 10.3 to 10.4 instead of 10.2 to 10.3
Jonathan Rose [Tue, 28 Feb 2012 20:43:49 +0000 (20:43 +0000)]
revision 357386 -- oops, accidentally made it 10.3 to 10.4 instead of 10.2 to 10.3

(issue ASTERISK-19352)
reported by: jamicque
........

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

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

11 years agoFix REF_DEBUG compile errors.
Richard Mudgett [Tue, 28 Feb 2012 20:34:11 +0000 (20:34 +0000)]
Fix REF_DEBUG compile errors.

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