]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
14 years agoAdded limits to the number of unauthenticated sessions TCP based protocols are allowe...
Matthew Nicholson [Thu, 21 Apr 2011 18:19:21 +0000 (18:19 +0000)] 
Added limits to the number of unauthenticated sessions TCP based protocols are allowed to have open simultaneously.  Also added timeouts for unauthenticated sessions where it made sense to do so.

Unrelated, the manager interface now properly checks if the user has the "system" privilege before executing shell commands via the Originate action.

AST-2011-005
AST-2011-006

(closes issue #18787)
Reported by: kobaz

(related to issue #18996)
Reported by: tzafrir

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

14 years agoapp_voicemail: Fix ODBC Storage compile
Alec L Davis [Tue, 19 Apr 2011 18:37:07 +0000 (18:37 +0000)] 
app_voicemail: Fix ODBC Storage compile

regression caused by me, from mantis bug #19032 / commit r312070

(closes issue #19142)
Reported by: vrban
Patches:
      app_voicemail_fix_for_312070.patch uploaded by vrban (license 756)
Tested by: vrban, alecdavis

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

14 years agoAsterisk does not hangup a channel after endpoint hangs up.
Richard Mudgett [Wed, 13 Apr 2011 16:21:24 +0000 (16:21 +0000)] 
Asterisk does not hangup a channel after endpoint hangs up.

If the call that the dialplan started an AGI script for is hungup while
the AGI script is in the middle of a command then the AGI script is not
notified of the hangup.  There are many AGI Exec commands that this can
happen with.  The reported applications have been: Background, Wait, Read,
and Dial.  Also the AGI Get Data command.

* Don't wait on the Asterisk channel after it has hung up.  The channel is
likely to never need servicing again.

* Restored the AGI script's ability to return the AGI_RESULT_HANGUP value
in run_agi().  It previously only could return AGI_RESULT_SUCCESS or
AGI_RESULT_FAILURE after the DeadAGI and AGI applications were merged.

(closes issue #17954)
Reported by: mn3250
Patches:
      issue17954_v1.8.patch uploaded by rmudgett (license 664)
      issue17954_v1.6.2.patch uploaded by rmudgett (license 664)
      issue17954_v1.4.patch uploaded by rmudgett (license 664)
Tested by: rmudgett
JIRA SWP-2171

(closes issue #18492)
Reported by: devmod
Tested by: rmudgett
JIRA SWP-2761

(closes issue #18935)
Reported by: nvitaly
Tested by: astmiv, rmudgett
JIRA SWP-3216

(closes issue #17393)
Reported by: siby
Tested by: rmudgett
JIRA SWP-2727

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

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

14 years agoFix detection of OpenSSL 1.0
Leif Madsen [Mon, 11 Apr 2011 19:30:20 +0000 (19:30 +0000)] 
Fix detection of OpenSSL 1.0

(closes issue #19093)
Reported by: tzafrir
Patches:
      detect_openssl_10.diff uploaded by tzafrir (license 46)

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

14 years agoStuck channel using FEATD_MF if caller hangs up at the right time.
Richard Mudgett [Mon, 11 Apr 2011 15:27:52 +0000 (15:27 +0000)] 
Stuck channel using FEATD_MF if caller hangs up at the right time.

The cause was actually a caller hanging up just at the end of the Feature
Group D DTMF tones that setup the call.  The reason for this is a "guard
timer" that's implemented using ast_safe_sleep(100).  If the caller
happens to hang up AFTER the final tone of the DTMF string but BEFORE the
end of that ast_safe_sleep(), then ast_safe_sleep() will return non-zero.
This causes the code to bounce to the end of ss_thread(), but it does NOT
tear down the call properly.

This should be a rare occurrence because the caller has to hang up at
EXACTLY the right time.  Nonetheless, it was happening quite regularly on
the reporter's system.  It's not easily reproducible, unless you purposely
increase the guard-time to 2000 or more.  Once you do that, you can
reproduce it every time by watching the DTMF debug and hanging up just as
it ends.

Simply add an ast_hangup() before goto quit.

(closes issue #15671)
Reported by: jcromes
Patches:
      issue15671.patch uploaded by pabelanger (license 224)
Tested by: jcromes

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

14 years agoLimit the number of unauthenticated manager sessions and also limit the time they...
Matthew Nicholson [Tue, 5 Apr 2011 14:10:34 +0000 (14:10 +0000)] 
Limit the number of unauthenticated manager sessions and also limit the time they have to authenticate.

AST-2011-005

(closes issue #18996)
Reported by: tzafrir
Tested by: mnicholson

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

14 years agoIssues with ISDN calls changing B channels during call negotiations.
Richard Mudgett [Mon, 4 Apr 2011 15:49:30 +0000 (15:49 +0000)] 
Issues with ISDN calls changing B channels during call negotiations.

The handling of the PROCEEDING message was not using the correct call
structure if the B channel was changed.  (The same for PROGRESS.) The call
was also not hungup if the new B channel is not provisioned or is busy.

* Made all call connection messages (SETUP_ACKNOWLEDGE, PROCEEDING,
PROGRESS, ALERTING, CONNECT, CONNECT_ACKNOWLEDGE) ensure that they are
using the correct structure and B channel.  If there is any problem with
the operations then the call is now hungup with an appropriate cause code.

* Made miscellaneous messages (INFORMATION, FACILITY, NOTIFY) find the
correct structure by looking for the call and not using the channel ID.
NOTIFY is an exception with versions of libpri before v1.4.11 because a
call pointer is not available for Asterisk to use.

* Made all hangup messages (DISCONNECT, RELEASE, RELEASE_COMPLETE) find
the correct structure by looking for the call and not using the channel
ID.

(closes issue #18313)
Reported by: destiny6628
Tested by: rmudgett
JIRA SWP-2620

(closes issue #18231)
Reported by: destiny6628
Tested by: rmudgett
JIRA SWP-2924

(closes issue #18488)
Reported by: jpokorny
JIRA SWP-2929

JIRA AST-437 (The issues fixed here are most likely causing this JIRA issue.)
JIRA DAHDI-406
JIRA LIBPRI-33 (Stuck resetting flag likely fixed)

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

14 years agoapp_voicemail: leave_vociemail doesn't use last_message_index to store next message
Alec L Davis [Fri, 1 Apr 2011 11:02:26 +0000 (11:02 +0000)] 
app_voicemail: leave_vociemail doesn't use last_message_index to store next message

trivial change to bring inline with 1.6.2 1.8 and trunk.
The symptom was if msg0000 was missing, and the last was msg0004,
the next msgnum would be msg0000 when it should have been msg0005

(issue #18998)
Reported by: tootai
Patches:
      bug18998.diff2.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

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

14 years agoFound some leaking file descriptors while looking at ast_FD_SETSIZE dead code.
Tilghman Lesher [Fri, 1 Apr 2011 10:36:42 +0000 (10:36 +0000)] 
Found some leaking file descriptors while looking at ast_FD_SETSIZE dead code.

(issue #18969)
 Reported by: oej
 Patches:
       20110315__issue18969__14.diff.txt uploaded by tilghman (license 14)

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

14 years agovoicemail: get real last_message_index and count_messages, ODBC resequence
Alec L Davis [Fri, 1 Apr 2011 08:29:49 +0000 (08:29 +0000)] 
voicemail: get real last_message_index and count_messages, ODBC resequence

change last_message_index to read the max msgnum stored in the database
change count_messages to actually count the number of messages.

last_message_index change:
  This fixed overwriting of the last message if msgnum=0 was missing.
  Previously every incoming message would overwrite msgnum=1.
count_messages change:
  allows us to detect when requencing is required in opneA_mailbox.
resequence enabled for ODBC storage:
  Assists with fixing up corrupt databases with gaps, but only when
  a user actively opens there mailboxes.

(closes issue #18692,#18582,#19032)
Reported by: elguero
Patches:
      based on odbc_resequence_mailbox2.1.diff uploaded by elguero (license 37)
Tested by: elguero, nivek, alecdavis

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

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

14 years agoapp_voicemail:close_mailbox imap_storage doesn't use last_msg_index
Alec L Davis [Fri, 1 Apr 2011 07:47:23 +0000 (07:47 +0000)] 
app_voicemail:close_mailbox imap_storage doesn't use last_msg_index

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

14 years agoapp_voicemail: close_mailbox needs to respect additional messages while mailbox is...
Alec L Davis [Fri, 1 Apr 2011 06:46:56 +0000 (06:46 +0000)] 
app_voicemail: close_mailbox needs to respect additional messages while mailbox is open.

close_mailbox leave gaps in message sequence if messages are deleted and new messages
arrive during this time, this is because the shuffle down to slot 0, only shuffles
the number of pre-existing messages when mailbox is opened, ignoring new arrivals.

Fix: in close_mailbox re-evaluate number of messages before the shuffle, this then includes new arrivals.

Happens on filebased or ODBC storage.

(issues #19032,#18582,#18692,#18998)
Reported by: alecdavis,tootai,afosorio

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

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

14 years agoDon't hold the pvt lock while streaming a file.
Matthew Nicholson [Thu, 17 Mar 2011 19:14:37 +0000 (19:14 +0000)] 
Don't hold the pvt lock while streaming a file.

ABE-2756

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

14 years agoDon't dec the usecount of an eventqent then use it.
Matthew Nicholson [Thu, 17 Mar 2011 19:09:37 +0000 (19:09 +0000)] 
Don't dec the usecount of an eventqent then use it.

ABE-2756

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

14 years agoRemove the provisional keepalive scheduler entry's reference to the pvt when we remov...
Matthew Nicholson [Thu, 17 Mar 2011 19:06:24 +0000 (19:06 +0000)] 
Remove the provisional keepalive scheduler entry's reference to the pvt when we remove the scheduler entry.

ABE-2756

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

14 years agoRemove extra quote in indications.conf
Alec L Davis [Thu, 17 Mar 2011 10:43:35 +0000 (10:43 +0000)] 
Remove extra quote in indications.conf

Picking low hanging fruit.

(closes issue #18971)
Reported by: IgorG
Patches:
      based on indications.conf.sample.diff uploaded by IgorG (license 20)
Tested by: IgorG

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

14 years agoDon't delay DTMF in core bridge while listening for DTMF features
Terry Wilson [Wed, 16 Mar 2011 16:58:42 +0000 (16:58 +0000)] 
Don't delay DTMF in core bridge while listening for DTMF features

This patch is mostly the work of Olle Johansson. I did some cleanup and
added the silence generating code if transmit_silence is set.

When a channel listens for DTMF in the core bridge, the outbound DTMF is not
sent until we have received DTMF_END. For a long DTMF, this is a disaster. We
send 4 seconds of DTMF to Asterisk, which sends no audio for those 4 seconds.
Some products see this delay and the time skew on RTP packets that results and
start ignoring the audio that is sent afterward.

With this change, the DTMF_BEGIN frame is inspected and checked. If it matches
a feature code, we wait for DTMF_END and activate the feature as before. If
transmit_silence=yes in asterisk.conf, silence is sent if we paritally match a
multi-digit feature. If it doesn't match a feature, the frame is forwarded
along with the DTMF_END without delay. By doing it this way, DTMF is not delayed.

(closes issue #15642)
Reported by: jasonshugart
Patches:
      issue_15652_dtmf_ast-1.4.patch.txt uploaded by twilson (license 396)
Tested by: globalnetinc, jde

(closes issue #16625)
Reported by: sharvanek

Review: https://reviewboard.asterisk.org/r/1092/
Review: https://reviewboard.asterisk.org/r/1125/

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

14 years agocore show locks: display ThreadID in hexadecimal
Alec L Davis [Tue, 15 Mar 2011 00:26:09 +0000 (00:26 +0000)] 
core show locks: display ThreadID in hexadecimal

Allow easier cross referencing of thread ID's with GDB backtraces

(closes issue #18968)
Reported by: alecdavis
Patches:
      bug18968.diff.txt uploaded by alecdavis (license 585)

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

14 years ago"Caller*ID failed checksum" on Wildcard TDM2400P and TDM410
Richard Mudgett [Mon, 14 Mar 2011 16:38:24 +0000 (16:38 +0000)] 
"Caller*ID failed checksum" on Wildcard TDM2400P and TDM410

The last character in the caller id message is getting a framing error.

The checksum is the last character in the message.  A framing error in the
checksum could be because:
1) The sender did not send a full stop bit.
2) The sender cut off the FSK carrier too soon.
3) The sender opted to send zero of the specified zero to 10 trailing mark
bits and round-off errors in the code resulted in the code not being where
it thought it was in the demodulated bit stream.

Bit 8 of 'b' is set when parity error.
Bit 9 of 'b' is set when framing error.

Made ignore the framing and parity error bits if the errored character is
the checksum.  We can tolerate a framing/parity error there.  The checksum
character validates the message.

(closes issue #18474)
Reported by: nivek
Patches:
      callerid.c.1.patch uploaded by nivek (license 636) (with modifications)
Tested by: nivek

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

14 years agoAdd AELSub, which provides a stable entry point into AEL subroutines.
Tilghman Lesher [Sat, 12 Mar 2011 20:22:07 +0000 (20:22 +0000)] 
Add AELSub, which provides a stable entry point into AEL subroutines.

This commit needs some explanation, given that we're adding a new application
into an existing release branch.  This is generally a violation of our release
policy, except in very limited circumstances, and I believe this is one of
those circumstances.

The problem that this solves is one of the sanity of using multiple dialplan
languages to define a dialplan.  In the case of the reporter, he or she is
using AEL is define subroutines, while using Realtime extensions to invoke
those subroutines.  While you can do this, it's based upon the reality of AEL
using actual dialplan extensions; however, there is no guarantee that the
details of _how_ AEL is compiled into extensions will remain stable.  In fact,
at the time of this commit, it has already changed twice, once in a
fundamental way.

Now normally, a new application would only be added to trunk.  However, this
application is explicitly to create a stable user-level API between versions,
and adding it to trunk only will not solve the user's problem of switching
between 1.6.2 and 1.8, nor will it help anybody switching from 1.8 to 1.10.
Therefore, it needs to go into existing release branches.  For the sake of
consistency, and also because one of the changes was between 1.4 and 1.6.x,
I am also electing to commit this to 1.4.

(closes issue #18910)
 Reported by: alexandrekeller
 Patches:
       20110304__issue18919__1.6.2.diff.txt uploaded by tilghman (license 14)
       20110304__issue18919__1.4.diff.txt uploaded by tilghman (license 14)
 Tested by: alexandrekeller

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

14 years agoInitialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.
Tilghman Lesher [Thu, 10 Mar 2011 05:38:44 +0000 (05:38 +0000)] 
Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.

(closes issue #18295)
 Reported by: pruiz

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

14 years agoDon't try to free statically allocated memory.
Terry Wilson [Tue, 8 Mar 2011 02:42:00 +0000 (02:42 +0000)] 
Don't try to free statically allocated memory.

Note: compiling after ./configure --enable-dev-mode will keep these
kinds of mistakes from being committed.

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

14 years agoBug fix for MixMonitor involving filenames with '.' not in the extension
Jonathan Rose [Mon, 7 Mar 2011 22:02:12 +0000 (22:02 +0000)] 
Bug fix for MixMonitor involving filenames with '.' not in the extension

Closes issue #18391)
Reported by: pabelanger
Patches:
      bugfix.patch uploaded by jrose (license 1225)
Tested by: jrose

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

14 years agofix small memory leak
David Ruggles [Fri, 4 Mar 2011 00:34:13 +0000 (00:34 +0000)] 
fix small memory leak

fix small memory leak caused by a string allocation that wasn't freed

(closes issue #18907)
Reported by: andy11
Patches:
      asterisk_trunk-app_externalivr-leak.patch uploaded by andy11 (license 1224)

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

14 years agoDon't broadcast FullyBooted to every AMI connection
Terry Wilson [Thu, 24 Feb 2011 17:42:16 +0000 (17:42 +0000)] 
Don't broadcast FullyBooted to every AMI connection

The FullyBooted event should not be sent to every AMI connection every
time someone connects via AMI. It should only be sent to the user who
just connected.

(closes issue #18168)
Reported by: FeyFre
Patches:
      bug0018168.patch uploaded by FeyFre (license 1142)
Tested by: FeyFre, twilson

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

14 years agosilence gcc 4.2 compiler warning
Matthew Nicholson [Thu, 24 Feb 2011 14:54:56 +0000 (14:54 +0000)] 
silence gcc 4.2 compiler warning

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

14 years agoProperly check the bounds of arrays when decoding UDPTL packets. Also, remove broken...
Matthew Nicholson [Mon, 21 Feb 2011 14:57:15 +0000 (14:57 +0000)] 
Properly check the bounds of arrays when decoding UDPTL packets.  Also, remove broken support for receiving UDPTL packets larger than 16k.  That shouldn't ever happen anyway.

AST-2011-002
FAX-281

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

14 years agoFix regression that changed behavior of queues when ringing a queue member.
Jason Parker [Tue, 15 Feb 2011 23:32:20 +0000 (23:32 +0000)] 
Fix regression that changed behavior of queues when ringing a queue member.

This reverts r298596, which was to fix a highly bizarre and contrived issue
with a queue member that called into his own queue being transferred back
into his own queue.  I couldn't reproduce that issue in any way.  I think one
of the other recent transfer fixes actually fixed this.

(closes issue #18747)
Reported by: vrban

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

14 years agoReentrancy problem if outgoing call gets different B channel than requested.
Richard Mudgett [Fri, 11 Feb 2011 00:29:17 +0000 (00:29 +0000)] 
Reentrancy problem if outgoing call gets different B channel than requested.

The chan_dahdi pri_fixup_principle() routine needs to protect the Asterisk
channel with the channel lock when it changes the technology private
pointer to a new private structure.

* Added lock protection while pri_fixup_principle() moves a call from one
private structure to another.

* Made some pri_fixup_principle() messages more meaningful.

Partial backport from v1.8 -r300714.

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

14 years agoRemove color when executing commands via a remote console.
Jason Parker [Thu, 10 Feb 2011 22:33:09 +0000 (22:33 +0000)] 
Remove color when executing commands via a remote console.

Essentially this makes '-x' imply '-n' on rasterisk.  This was done in a
different and incomplete way previously, which I'll be reverting shortly.

(issue #18776)
Reported by: alecdavis

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

14 years agoFix comparison for REFER Replaces tags with pedantic=yes
Terry Wilson [Tue, 8 Feb 2011 20:05:13 +0000 (20:05 +0000)] 
Fix comparison for REFER Replaces tags with pedantic=yes

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

14 years agofix this line again
Jeff Peeler [Tue, 8 Feb 2011 19:40:58 +0000 (19:40 +0000)] 
fix this line again

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

14 years agoclean this up, sorry my brain is not really working
Jeff Peeler [Tue, 8 Feb 2011 19:28:58 +0000 (19:28 +0000)] 
clean this up, sorry my brain is not really working

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

14 years agoBackup file storing message duration is not used with IMAP_STORAGE, remove code.
Jeff Peeler [Tue, 8 Feb 2011 19:18:50 +0000 (19:18 +0000)] 
Backup file storing message duration is not used with IMAP_STORAGE, remove code.

The message duration is stored in the body of the email when using IMAP_STORAGE,
so nothing needs to happen with the backup file.

(closes issue #18718)
Reported by: kerframil

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

14 years agomake this safer and fully correct, pointed out by Steve Davis
Jeff Peeler [Tue, 8 Feb 2011 16:19:17 +0000 (16:19 +0000)] 
make this safer and fully correct, pointed out by Steve Davis

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

14 years agoDon't try to pickup a call in the middle of a masquerade
Terry Wilson [Mon, 7 Feb 2011 22:35:20 +0000 (22:35 +0000)] 
Don't try to pickup a call in the middle of a masquerade

If A calls B which doesn't answer and C & D both try to do a call pickup, it is
possible for ast_pickup_call to answer the call, then fail to masquerade one of
the calls because the other one is already in the process of masquerading. This
patch checks to see if the channel is in the process of masquerading before
call before selecting it for a pickup.

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

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

14 years agoDon't allow a REFER w/replaces to replace its own dialog
Terry Wilson [Mon, 7 Feb 2011 21:51:43 +0000 (21:51 +0000)] 
Don't allow a REFER w/replaces to replace its own dialog

Asterisk currently accepts a REFER with a Refer-To with an embedded Replaces
header that matches the dialog of the REFER. This would be a situation like A
calls B, A calls C, A transfers B to A, which is just silly. This patch makes
the transfer fail instead of making Asterisk freak out and forget to hang other
channels up.

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

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

14 years agoFix no MOH and frame queueing problem for parked calls.
Jeff Peeler [Thu, 3 Feb 2011 20:43:59 +0000 (20:43 +0000)] 
Fix no MOH and frame queueing problem for parked calls.

This was a regression introduced when select was changed to poll and was
just a conversion error: POLLPRI detects OOB data, not POLLERR.

(closes issue #18637)
Reported by: jvandal

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

14 years agoSet hangup cause in local_hangup
Terry Wilson [Thu, 3 Feb 2011 20:36:34 +0000 (20:36 +0000)] 
Set hangup cause in local_hangup

When a call involves a local channel (like SIP -> Local -> SIP), the hangup
cause was not being set. This resulted in SIP channels sometimes getting a
503 error instead of a 486 when the far side sent a busy. In Asterisk 1.8+
this also can cause issues with CCSS that involve a local channel. This patch
sets the hangupcause for one side of the local channel to the other in
local_hangup for outbound calls.

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

14 years agoMinor AST_FRAME_TEXT related issues.
Richard Mudgett [Thu, 3 Feb 2011 00:02:43 +0000 (00:02 +0000)] 
Minor AST_FRAME_TEXT related issues.

* Include the null terminator in the buffer length.  When the frame is
queued it is copied.  If the null terminator is not part of the frame
buffer length, the receiver could see garbage appended onto it.

* Add channel lock protection with ast_sendtext().

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

14 years agoClose file descriptor for timing source when a MOH class gets destroyed.
Jason Parker [Tue, 1 Feb 2011 17:00:55 +0000 (17:00 +0000)] 
Close file descriptor for timing source when a MOH class gets destroyed.

(closes issue #18457)
Reported by: mcallist
Patches:
      18457-closetimer.diff uploaded by qwell (license 4)
      18457-closetimer_trunk.diff uploaded by qwell (license 4)
Tested by: qwell, loloski

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

14 years agoObtain the pri lock for PRI queue counters.
Richard Mudgett [Mon, 31 Jan 2011 23:45:58 +0000 (23:45 +0000)] 
Obtain the pri lock for PRI queue counters.

Need to obtain the pri lock when calling pri_dump_info_str() to avoid a
reentrancy problem when calculating the Q.921 Q count statistic.

JIRA AST-484

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

14 years agoPrevent a crash when dialing a technology with no destination (ex: Dial(SIP/))
Jason Parker [Mon, 31 Jan 2011 22:56:54 +0000 (22:56 +0000)] 
Prevent a crash when dialing a technology with no destination (ex: Dial(SIP/))

chan_iax2 and other channel drivers already had code to prevent this.  The
attempt that app_dial was making to prevent it was not correct, so I fixed that.

(closes issue #18371)
Reported by: gbour
Patches:
      18371.patch uploaded by gbour (license 1162)

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

14 years agoSet file descriptors to -1 on creation, so that we don't see weirdness later.
Jason Parker [Mon, 31 Jan 2011 20:56:25 +0000 (20:56 +0000)] 
Set file descriptors to -1 on creation, so that we don't see weirdness later.

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

14 years agoFix compilation when ODBC_STORAGE is defined.
Tilghman Lesher [Mon, 31 Jan 2011 06:54:45 +0000 (06:54 +0000)] 
Fix compilation when ODBC_STORAGE is defined.

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

14 years agoBackport MeetMe related reference leaks fixes from 1.6.2/1.8/trunk.
Sean Bright [Sat, 29 Jan 2011 21:48:30 +0000 (21:48 +0000)] 
Backport MeetMe related reference leaks fixes from 1.6.2/1.8/trunk.

I had forgotten that MeetMe in 1.4 also used astobj2, so backport the fixes
where appropriate.

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

14 years agoFix default prefix=/usr regression on non-Linux systems.
Jason Parker [Thu, 27 Jan 2011 16:57:46 +0000 (16:57 +0000)] 
Fix default prefix=/usr regression on non-Linux systems.

This partially reverts a change made in branches/1.4/ r267759, which will
cause issue #17013 to be reopened.  This issue was pointed out by a user
on #asterisk, who helpfully discovered that paths were being set incorrectly.

To truly understand what was wrong, one should run:
    svn diff --force -c<this revision> configure

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

14 years agoRerun bootstrap.sh with no changes, so that it is more obvious what my next commit...
Jason Parker [Thu, 27 Jan 2011 16:47:03 +0000 (16:47 +0000)] 
Rerun bootstrap.sh with no changes, so that it is more obvious what my next commit changes.

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

14 years agoConvert from network to host byte ordering before checking if an IP is a multicast...
Matthew Nicholson [Wed, 26 Jan 2011 21:00:15 +0000 (21:00 +0000)] 
Convert from network to host byte ordering before checking if an IP is a multicast address.

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

14 years agoGet rid of unused 'verbose' field in ast_udptl
Mark Michelson [Wed, 26 Jan 2011 20:38:37 +0000 (20:38 +0000)] 
Get rid of unused 'verbose' field in ast_udptl

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

14 years agoThis patch modifies chan_sip to route responses to the address the request came from...
Matthew Nicholson [Wed, 26 Jan 2011 20:38:22 +0000 (20:38 +0000)] 
This patch modifies chan_sip to route responses to the address the request came from.  It also modifies chan_sip to respect the maddr parameter in the Via header.

ABE-2664

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

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

14 years agoMake sure the sample queues.conf is properly commented.
Sean Bright [Wed, 26 Jan 2011 20:18:29 +0000 (20:18 +0000)] 
Make sure the sample queues.conf is properly commented.

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

14 years agoDTMF attended transfers sometimes fail for no apparent reason.
Richard Mudgett [Tue, 25 Jan 2011 23:21:09 +0000 (23:21 +0000)] 
DTMF attended transfers sometimes fail for no apparent reason.

The loop in feature_request_and_dial() can exit when Party C has answered
without processing an AST_CONTROL_ANSWER.  Also sometimes an
AST_CONTROL_ANSWER never happens even though Party C has answered.

Don't hangup Party C if he is up or we receive an AST_CONTROL_ANSWER.

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

14 years agoGuard against retransmitting BYEs indefinitely
Terry Wilson [Tue, 25 Jan 2011 20:50:59 +0000 (20:50 +0000)] 
Guard against retransmitting BYEs indefinitely

In the case of an attended transfer (A calls B, A atxfers to C) where
A becomes unreachable before replying to Asterisk's BYE, Asterisk can
sometimes retransmit the BYE indefinitely. This is because
__sip_autodestruct tests p->refer && !ast_test_flag(&p->flags[0],
SIP_ALREADYGONE and will then transmit a BYE. When this BYE times out,
it will not ever be marked as ALREADYGONE, so when __sip_autodestruct
is called again, we end up starting the cycle over.

This patch adds a call to sip_alreadygone(pkt->owner) in retrans_pkt
in the case of a BYE that has timed out. This should prevent Asterisk
from trying to transmit new BYE messages in the future.

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

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

14 years agoSending out unnecessary PROCEEDING messages breaks overlap dialing.
Richard Mudgett [Tue, 25 Jan 2011 17:36:50 +0000 (17:36 +0000)] 
Sending out unnecessary PROCEEDING messages breaks overlap dialing.

Issue #16789 was a good idea.  Unfortunately, it breaks overlap dialing
through Asterisk.  There is not enough information available at this point
to know if dialing is complete.  The ast_exists_extension(),
ast_matchmore_extension(), and ast_canmatch_extension() calls are not
adequate to detect a dial through extension pattern of "_9!".

Workaround is to use the dialplan Proceeding() application early in
non-dial through extensions.

* Effectively revert issue #16789.

* Allow outgoing overlap dialing to hear dialtone and other early media.
A PROGRESS "inband-information is now available" message is now sent after
the SETUP_ACKNOWLEDGE message for non-digital calls.  An
AST_CONTROL_PROGRESS is now generated for incoming SETUP_ACKNOWLEDGE
messages for non-digital calls.

* Handling of the AST_CONTROL_CONGESTION in chan_dahdi/sig_pri was
inconsistent with the cause codes.

* Added better protection from sending out of sequence messages by
combining several flags into a single enum value representing call
progress level.

* Added diagnostic messages for deferred overlap digits handling corner
cases.

(closes issue #17085)
Reported by: shawkris

(closes issue #18509)
Reported by: wimpy
Patches:
      issue18509_early_media_v1.8_v3.patch uploaded by rmudgett (license 664)
      Expanded upon issue18509_early_media_v1.8_v3.patch to include analog
      and SS7 because of backporting requirements.
Tested by: wimpy, rmudgett

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

14 years agoBackport the Proceeding application.
Richard Mudgett [Tue, 25 Jan 2011 17:31:18 +0000 (17:31 +0000)] 
Backport the Proceeding application.

Added in trunk -r129399.

Enable the workaround for issue #17085 and #18509.

(issue #17085)
(issue #18509)

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

14 years agoFix voicemail sequencing for file based storage.
Jeff Peeler [Tue, 25 Jan 2011 16:58:29 +0000 (16:58 +0000)] 
Fix voicemail sequencing for file based storage.

A previous change was made to account for when the number of voicemail messages
exceeds the max limit to be handled properly, but it caused gaps in the messages
to not be properly handled. This has now been resolved.

In later non 1.4 branches, it appears that resequencing wasn't even occurring
due from what appears and accidental code removal.

(closes issue #18498)
Reported by: JJCinAZ
Patches:
      bug18498v2.patch uploaded by jpeeler (license 325)

(closes issue #18486)
Reported by: bluefox
Patches:
      bug18486.patch uploaded by jpeeler (license 325)

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

14 years agoFix a couple of mistakes in the backport of this patch to 1.4.
Russell Bryant [Mon, 24 Jan 2011 20:57:42 +0000 (20:57 +0000)] 
Fix a couple of mistakes in the backport of this patch to 1.4.

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

14 years agoFix channel redirect out of MeetMe() and other issues with channel softhangup.
Russell Bryant [Mon, 24 Jan 2011 20:32:21 +0000 (20:32 +0000)] 
Fix channel redirect out of MeetMe() and other issues with channel softhangup.

Mantis issue #18585 reports that a channel redirect out of MeetMe() stopped
working properly.  This issue includes a patch that resolves the issue by
removing a call to ast_check_hangup() from app_meetme.c.  I left that in my
patch, as it doesn't need to be there.  However, the rest of the patch fixes
this problem with or without the change to app_meetme.

The key difference between what happens before and after this patch is the
effect of the END_OF_Q control frame.  After END_OF_Q is hit in ast_read(),
ast_read() will return NULL.  With the ast_check_hangup() removed, app_meetme
sees this which causes it to exit as intended.  Checking ast_check_hangup()
caused app_meetme to exit earlier in the process, and the target of the
redirect saw the condition where ast_read() returned NULL.

Removing ast_check_hangup() works around the issue in app_meetme, but doesn't
solve the issue if another application did the same thing.  There are also
other edge cases where if an application finishes at the same time that a
redirect happens, the target of the redirect will think that the channel hung
up.  So, I made some changes in pbx.c to resolve it at a deeper level.  There
are already places that unset the SOFTHANGUP_ASYNCGOTO flag in an attempt to
abort the hangup process.  My patch extends this to remove the END_OF_Q frame
from the channel's read queue, making the "abort hangup" more complete.  This
same technique was used in every place where a softhangup flag was cleared.

(closes issue #18585)
Reported by: oej
Tested by: oej, wedhorn, russell

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

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

14 years agoReset configuration before parsing users.conf.
Jason Parker [Fri, 21 Jan 2011 21:45:34 +0000 (21:45 +0000)] 
Reset configuration before parsing users.conf.

Some values configured in chan_dahdi.conf were able to leak in to users.conf
configuration.  This was surprising users, and potentially setting non-sane
"defaults".

ASTNOW-125

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

14 years agoAdd new queue strategy to preserve behavior for when queue members moved to ao2.
Jeff Peeler [Thu, 20 Jan 2011 17:04:08 +0000 (17:04 +0000)] 
Add new queue strategy to preserve behavior for when queue members moved to ao2.

Add queue strategy called "rrordered" to mimic old behavior from when queue
members were stored in a linked list.

ABE-2707

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

14 years agoOption L() is milliseconds, not seconds.
Leif Madsen [Thu, 20 Jan 2011 15:38:33 +0000 (15:38 +0000)] 
Option L() is milliseconds, not seconds.
Change the verbose output of option L() to say milliseconds and not seconds
as the value is in milliseconds.

(closes issue #18264)
Reported by: jacco
Patches:
      app_dial_patch.txt uploaded by lmadsen (license 10)
Tested by: lmadsen, jacco

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

14 years agoDTMF transfer plays the wrong sounds for wrong number or other call failure.
Richard Mudgett [Wed, 19 Jan 2011 21:21:56 +0000 (21:21 +0000)] 
DTMF transfer plays the wrong sounds for wrong number or other call failure.

* Set the default for features.conf.sample xferfailsound option to "beeperr"
as documented instead of "pbx-invalid" and corrected the use of it in DTMF
blind transfer (#1).

* Improved DTMF blind transfer handling of wrong numbers.

Most of the concerns in this issue were taken care of by the patch for
issue 17999: Issues with DTMF triggered attended transfers.

(closes issue #18379)
Reported by: gincantalupo
Tested by: rmudgett

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

14 years agoAdd some API documentation
Tilghman Lesher [Wed, 19 Jan 2011 21:20:28 +0000 (21:20 +0000)] 
Add some API documentation

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

14 years agoURI encode the user part of the contact header.
Matthew Nicholson [Tue, 18 Jan 2011 21:35:03 +0000 (21:35 +0000)] 
URI encode the user part of the contact header.

ABE-2705

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

14 years agoIssues with DTMF triggered attended transfers.
Richard Mudgett [Tue, 18 Jan 2011 18:04:36 +0000 (18:04 +0000)] 
Issues with DTMF triggered attended transfers.

Issue #17999
1) A calls B. B answers.
2) B using DTMF dial *2 (code in features.conf for attended transfer).
3) A hears MOH. B dial number C
4) C ringing. A hears MOH.
5) B hangup. A still hears MOH. C ringing.
6) A hangup. C still ringing until "atxfernoanswertimeout" expires.
For v1.4 C will ring forever until C answers the dead line. (Issue #17096)

Problem: When A and B hangup, C is still ringing.

Issue #18395
SIP call limit of B is 1
1. A call B, B answered
2. B *2(atxfer) call C
3. B hangup, C ringing
4. Timeout waiting for C to answer
5. Recall to B fails because B has reached its call limit.

Because B reached its call limit, it cannot do anything until the transfer
it started completes.

Issue #17273
Same scenario as issue 18395 but party B is an FXS port.  Party B cannot
do anything until the transfer it started completes.  If B goes back off
hook before C answers, B hears ringback instead of the expected dialtone.

**********
Note for the issue #17273 and #18395 fix:

DTMF attended transfer works within the channel bridge.  Unfortunately,
when either party A or B in the channel bridge hangs up, that channel is
not completely hung up until the transfer completes.  This is a real
problem depending upon the channel technology involved.

For chan_dahdi, the channel is crippled until the hangup is complete.
Either the channel is not useable (analog) or the protocol disconnect
messages are held up (PRI/BRI/SS7) and the media is not released.

For chan_sip, a call limit of one is going to block that endpoint from any
further calls until the hangup is complete.

For party A this is a minor problem.  The party A channel will only be in
this condition while party B is dialing and when party B and C are
conferring.  The conversation between party B and C is expected to be a
short one.  Party B is either asking a question of party C or announcing
party A.  Also party A does not have much incentive to hangup at this
point.

For party B this can be a major problem during a blonde transfer.  (A
blonde transfer is our term for an attended transfer that is converted
into a blind transfer.  :)) Party B could be the operator.  When party B
hangs up, he assumes that he is out of the original call entirely.  The
party B channel will be in this condition while party C is ringing, while
attempting to recall party B, and while waiting between call attempts.

WARNING:
The ATXFER_NULL_TECH conditional is a hack to fix the problem.  It will
replace the party B channel technology with a NULL channel driver to
complete hanging up the party B channel technology.  The consequences of
this code is that the 'h' extension will not be able to access any channel
technology specific information like SIP statistics for the call.

ATXFER_NULL_TECH is not defined by default.
**********

(closes issue #17999)
Reported by: iskatel
Tested by: rmudgett
JIRA SWP-2246

(closes issue #17096)
Reported by: gelo
Tested by: rmudgett
JIRA SWP-1192

(closes issue #18395)
Reported by: shihchuan
Tested by: rmudgett

(closes issue #17273)
Reported by: grecco
Tested by: rmudgett

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

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

14 years agoMerged revisions 293493 via svnmerge from
Terry Wilson [Mon, 17 Jan 2011 17:45:39 +0000 (17:45 +0000)] 
Merged revisions 293493 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 [^]

........
  r293493 | twilson | 2010-11-01 09:58:00 -0500 (Mon, 01 Nov 2010) | 14 lines

  Only offer codecs both sides support for directmedia

  When using directmedia, Asterisk needs to limit the codecs offered to just
  the ones that both sides recognize, otherwise they may end up sending audio
  that the other side doesn't understand.

  (closes issue 0017403)
  Reported by: one47
  Patches:
        sip_codecs_simplified4 uploaded by one47 (license 23)
  Tested by: one47, falves11

  Review: https://reviewboard.asterisk.org/r/967/ [^]
........

Back port a fix that should have been included

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

14 years agoFix issue with cross-compiling failing
Leif Madsen [Fri, 14 Jan 2011 20:21:00 +0000 (20:21 +0000)] 
Fix issue with cross-compiling failing

(closes issue #18301)
Reported by: abelbeck
Patches:
      asterisk-1.4-bugid18301.patch.txt uploaded by abelbeck (license 946)
Tested by: abelbeck, russellb

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

14 years agoDon't store the thread id for the manager session in the structure we pass to
Matthew Nicholson [Wed, 12 Jan 2011 18:39:03 +0000 (18:39 +0000)] 
Don't store the thread id for the manager session in the structure we pass to
the thread for the manager session.

ABE-2543

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

14 years agoFix CPU spike when pressing DTMF after agent login.
Jeff Peeler [Wed, 12 Jan 2011 18:10:42 +0000 (18:10 +0000)] 
Fix CPU spike when pressing DTMF after agent login.

The problem here is that DTMF was being continuously deferred and requeued
since ast_safe_sleep is called in a loop. There are serveral other places in the
code that sleeps and then loops in a similar fashion. Because of this fact I
opted to not defer DTMF any more, which will not affect the original fix:

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

(closes issue #18130)
Reported by: rgj

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

14 years agoPrevent buffer overflows in ast_uri_encode()
Matthew Nicholson [Tue, 11 Jan 2011 18:34:40 +0000 (18:34 +0000)] 
Prevent buffer overflows in ast_uri_encode()

ABE-2705

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

14 years agochange variable name to the same used in later branches
Jeff Peeler [Fri, 7 Jan 2011 17:18:11 +0000 (17:18 +0000)] 
change variable name to the same used in later branches

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

14 years agoEnsure good bye prompt in voicemail is played at the correct time.
Jeff Peeler [Fri, 7 Jan 2011 17:13:21 +0000 (17:13 +0000)] 
Ensure good bye prompt in voicemail is played at the correct time.

Specifically in the case of timing out but not leaving voicemail nothing
should be heard. And when leaving voicemail it should be heard.

ABE-2647

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

14 years agoUse the sanity check in place of the disconnect/connect cycle.
Tilghman Lesher [Wed, 5 Jan 2011 18:47:46 +0000 (18:47 +0000)] 
Use the sanity check in place of the disconnect/connect cycle.

The disconnect/connect cycle has the potential to cause random crashes.

(closes issue #18243)
 Reported by: ks3
 Patches:
       res_odbc.patch uploaded by ks3 (license 1147)
 Tested by: ks3

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

14 years agoUpdate the autosupport script from Digium support.
Russell Bryant [Tue, 4 Jan 2011 20:56:04 +0000 (20:56 +0000)] 
Update the autosupport script from Digium support.

(closes AST-395)

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

14 years agoDon't authenticate SUBSCRIBE re-transmissions
Terry Wilson [Tue, 4 Jan 2011 17:11:48 +0000 (17:11 +0000)] 
Don't authenticate SUBSCRIBE re-transmissions

This only skips authentication on retransmissions that are already
authenticated. A similar method is already used for INVITES. This
is the kind of thing we end up having to do when we don't have a
transaction layer...

(closes issue #18075)
Reported by: mdu113
Patches:
      diff.txt uploaded by twilson (license 396)
Tested by: twilson, mdu113

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

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

14 years agoMove check for extension existence below variable inheritance, due to the possible...
Tilghman Lesher [Sat, 25 Dec 2010 10:04:06 +0000 (10:04 +0000)] 
Move check for extension existence below variable inheritance, due to the possible use of an eswitch.

(closes issue #16228)
 Reported by: jlaguilar

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

14 years agoUse ast_free() instead of free()
Matthew Nicholson [Mon, 20 Dec 2010 21:21:39 +0000 (21:21 +0000)] 
Use ast_free() instead of free()

ABE-2656

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

14 years agoRemove changes to via processing that were not supposed to go into the last commit.
Matthew Nicholson [Mon, 20 Dec 2010 21:00:44 +0000 (21:00 +0000)] 
Remove changes to via processing that were not supposed to go into the last commit.

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

14 years agoRespond as soon as possible with a 202 Accepted to refer requests.
Matthew Nicholson [Mon, 20 Dec 2010 20:45:38 +0000 (20:45 +0000)] 
Respond as soon as possible with a 202 Accepted to refer requests.

This change also plugs a few memory leaks that can occur when parking sip calls.

ABE-2656

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

14 years agoTypos: recieved => received
Tzafrir Cohen [Mon, 20 Dec 2010 09:13:18 +0000 (09:13 +0000)] 
Typos: recieved => received

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

14 years agoLet Asterisk find better backtrace information with libbfd.
Tilghman Lesher [Fri, 17 Dec 2010 21:40:56 +0000 (21:40 +0000)] 
Let Asterisk find better backtrace information with libbfd.

The menuselect option BETTER_BACKTRACES, if enabled, will use libbfd to search
for better symbol information within both the Asterisk binary, as well as
loaded modules, to assist when using inline backtraces to track down problems.

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

14 years agoDocument the -F option.
Tilghman Lesher [Fri, 17 Dec 2010 21:12:00 +0000 (21:12 +0000)] 
Document the -F option.

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

14 years agoAfter recording only silence for a voicemail prepending, restore backup files.
Jeff Peeler [Thu, 16 Dec 2010 23:29:30 +0000 (23:29 +0000)] 
After recording only silence for a voicemail prepending, restore backup files.

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

14 years agoFix improper hangup when doing an attended transfer to queue.
Jeff Peeler [Thu, 16 Dec 2010 20:46:52 +0000 (20:46 +0000)] 
Fix improper hangup when doing an attended transfer to queue.

Had to indicate ringing in wait_for_answer so the attended transfer code would
not try and hang up the local channel it created, which would kill the call.

ABE-2624

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

14 years agoOnly increment the pointer once per loop, otherwise we corrupt the value.
Tilghman Lesher [Thu, 16 Dec 2010 09:03:40 +0000 (09:03 +0000)] 
Only increment the pointer once per loop, otherwise we corrupt the value.

(closes issue #18251)
 Reported by: bcnit
 Patches:
       20101110__issue18251.diff.txt uploaded by tilghman (license 14)
 Tested by: trev, jthurman, elguero

(closes issue #18279)
 Reported by: zerohalo
 Patches:
       20101109__issue18279.diff.txt uploaded by tilghman (license 14)
 Tested by: zerohalo

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

14 years agoUnregister before shutting down the connection, to avoid a race.
Tilghman Lesher [Thu, 16 Dec 2010 00:28:04 +0000 (00:28 +0000)] 
Unregister before shutting down the connection, to avoid a race.

(closes issue #18481)
 Reported by: pabelanger
 Patches:
       20101215__issue18481.diff.txt uploaded by tilghman (license 14)
 Tested by: pabelanger

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

14 years agoFix reference and container leaks when running 'astobj2 test.'
Sean Bright [Wed, 15 Dec 2010 21:28:29 +0000 (21:28 +0000)] 
Fix reference and container leaks when running 'astobj2 test.'

We need to make sure that ao2_iterator_destroy is called once for each time that
ao2_iterator_init is called.  Also make sure to unref a newly allocated object
that we've linked into a container.

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

14 years agoOutgoing PRI/BRI calls cannot do DTMF triggered transfers.
Richard Mudgett [Mon, 13 Dec 2010 16:56:07 +0000 (16:56 +0000)] 
Outgoing PRI/BRI calls cannot do DTMF triggered transfers.

Outgoing PRI/BRI calls cannot do DTMF triggered transfers if a PROCEEDING
message is not received.  The debug output shows that the DTMF begin event
is seen, but the DTMF end event is missing.  When the DTMF begin happens,
the call is muted so we now have one way audio (until a DTMF end event is
somehow seen).

* Made set the proceeding flag when the PRI_EVENT_ANSWER event is
received.

* Made absorb the DTMF begin and DTMF end events if we are overlap dialing
and have not seen a PROCEEDING message.

* Added a debug message when absorbing a DTMF event.

JIRA SWP-2690
JIRA ABE-2697

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

14 years agoIgnore spurious REGISTER requests
Terry Wilson [Thu, 9 Dec 2010 22:00:30 +0000 (22:00 +0000)] 
Ignore spurious REGISTER requests

If a REGISTER request with a Call-ID matching an existing transaction is received
it was possible that the REGISTER request would overwrite the initreq of the
private structure. This info is used to generate messages for other responses in
the transaction. This patch ignores REGISTER requests that match non-REGISTER
transactions.

(closes issue #18051)
Reported by: eeman
Tested by: twilson

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

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

14 years agoRevert code that changed SSRC for DTMF.
Jeff Peeler [Tue, 7 Dec 2010 22:57:48 +0000 (22:57 +0000)] 
Revert code that changed SSRC for DTMF.

Some previous behavior was attempted to be restored, but mistakingly I did
not realize that the previous behavior was incorrect. This fixes DTMF not
being detected since DTMF shouldn't cause the SSRC to change.

(related to issue #17404)
(closes issue #18189)
(closes issue #18352)
Reported by: marcbou
Tested by: cmbaker82

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

14 years agoUse non-deprecated APIs for CoreAudio
Tilghman Lesher [Tue, 7 Dec 2010 22:35:50 +0000 (22:35 +0000)] 
Use non-deprecated APIs for CoreAudio

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

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

14 years agoAvoid a crash if we don't pass an argument to 'astobj2 test.'
Sean Bright [Tue, 7 Dec 2010 15:23:18 +0000 (15:23 +0000)] 
Avoid a crash if we don't pass an argument to 'astobj2 test.'

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

14 years agoDon't create a Local channel if the target extension does not exist.
Tilghman Lesher [Tue, 7 Dec 2010 00:07:37 +0000 (00:07 +0000)] 
Don't create a Local channel if the target extension does not exist.

(closes issue #18126)
 Reported by: junky
 Patches:
       followme.diff uploaded by junky (license 177)
       (partially restructured by me to avoid a possible memory leak)

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

14 years agoImprove handling of REGISTER requests with multiple contact headers.
Jeff Peeler [Mon, 6 Dec 2010 21:57:15 +0000 (21:57 +0000)] 
Improve handling of REGISTER requests with multiple contact headers.

The changes here attempt to more strictly follow RFC 3261 section 10.3.
Basically the following will now cause a 400 Bad Response to be returned, if:
- multiple Contact headers are present with one set to expire all bindings ("*")
- wildcard parameter is specified for Contact without Expires header or Expires
  header is not set to zero.

ABE-2442
ABE-2443

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

14 years agoResolve compile error under FreeBSD
Paul Belanger [Thu, 2 Dec 2010 20:01:08 +0000 (20:01 +0000)] 
Resolve compile error under FreeBSD

We now set _ASTCFLAGS+=-march=i686 for i386 processors, still allowing ASTCFLAGS
to override the setting.

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

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

14 years agoInitialize offset for adaptive jitter buffer
Terry Wilson [Thu, 2 Dec 2010 18:00:27 +0000 (18:00 +0000)] 
Initialize offset for adaptive jitter buffer

When the adaptive jitter buffer is enabled in sip.conf, the first frame placed
in the jitter buffer fails with something like:

jb_warning_output: Resyncing the jb. last_delay 0, this delay -215886466,
threshold 1000, new offset 215886466

This happens because the offset is not initialized before calling jb_put(). This
patch modifies jb_put_first_adaptive() to set the offset to the frame's
timestamp.

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

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

14 years agoAdd "DAHDI" to a couple of app_meetme error messages.
Russell Bryant [Thu, 2 Dec 2010 13:16:15 +0000 (13:16 +0000)] 
Add "DAHDI" to a couple of app_meetme error messages.

This is in response to some questions on IRC.  To the user, there was nothing
that made it obvious that this error had anything to do with DAHDI not being
loaded.

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

14 years agoIf we get a NOTIFY from a non-existing subscription we should answer with 481, not...
Olle Johansson [Thu, 2 Dec 2010 08:37:17 +0000 (08:37 +0000)] 
If we get a NOTIFY from a non-existing subscription we should answer with 481, not bad event.

If we answer 481 the subscription that we don't want will be cancelled.

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

14 years agoFix not stopping MOH when transfered local channel queue member is answered.
Jeff Peeler [Wed, 1 Dec 2010 17:50:09 +0000 (17:50 +0000)] 
Fix not stopping MOH when transfered local channel queue member is answered.

The problem here is only present when local channels are used with the MOH
passthru option as well as no optimization (/nm). I will describe the slightly
bizarre scenario that was used to test, where phones B and C are queue members:

Phone A dials into a queue with two members using local channels and the above
options. Phone B answers. Phone A blind transfers phone B into the same queue.
Phone A hangs up. Phone C answers, but phone B didn't stop playing MOH.

In this scenario, the unhold frame that should have gotten to phone B never
arrived due to the masquerade from the blind transfer. This is usually fine
since app_queue manages the starting and stopping of MOH. However, with the
passthrough option enabled when app_queue attempts to stop MOH it tries to do
so on the local channel rather than the real channel. The easiest solution
was to just make sure to send an unhold frame during the transfer since it
wouldn't make sense to have MOH playing after a transfer anyway. This only
modifies SIP transfers, but the other transfers did not seem to be a problem.
If DTMF based transfers were a problem it might be okay to add ast_moh_stop
to finishup, but I didn't want to have to add that unless required.

ABE-2624

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