]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
15 years agomake chan_sip compile under devmode again
Michiel van Baak [Fri, 4 Sep 2009 13:53:09 +0000 (13:53 +0000)] 
make chan_sip compile under devmode again

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

15 years agoMake apps send PROGRESS control frame for early media and fix too early media issue...
Olle Johansson [Fri, 4 Sep 2009 13:45:48 +0000 (13:45 +0000)] 
Make apps send PROGRESS control frame for early media and fix too early media issue in SIP

The issue at hand is that some legacy (dying) PBX systems send empty media frames on PRI
links *before* any call progress. The SIP channel receives these frames and by default
signals 183 Session progress and starts sending media. This will cause phones to
play silence and ignore the later 180 ringing message. A bad user experience.

The fix is twofold:
- We discovered that asterisk apps that support early media ("noanswer") did not send
  any PROGRESS frame to indicate early media. Fixed.
- We introduce a setting in chan_sip so that users can disable any relay of media frames
  before the outbound channel actually indicates any sort of call progress.
  In 1.4, 1.6.0 and 1.6.1, this will be disabled for backward compatibility. In later versions
  of Asterisk, this will be enabled. We don't assume that it will change your Asterisk
  phone experience - only for the better.

We encourage third-party application developers to make sure that if they have applications
that wants to send early media, add a PROGRESS control frame transmission to make sure that
all channel drivers actually will start sending early media. This has not been the default
in Asterisk previous to this patch, so if you got inspiration from our code, you need to
update accordingly. Sorry for the trouble and thanks for your support.

This code has been running for a few months in a large scale installation (over 250
servers with PRI and/or BRI links to old PBX systems).
That's no proof that this is an excellent patch, but, well, it's tested :-)

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

15 years agoMake sure 'start' is always initialized.
Michiel van Baak [Fri, 4 Sep 2009 13:16:29 +0000 (13:16 +0000)] 
Make sure 'start' is always initialized.

This is the same as rev 216222 in trunk but 1.4 is affected as well

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

15 years agoMerged revisions 216262 via svnmerge from
Russell Bryant [Fri, 4 Sep 2009 10:48:00 +0000 (10:48 +0000)] 
Merged revisions 216262 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r216262 | russell | 2009-09-04 05:47:37 -0500 (Fri, 04 Sep 2009) | 2 lines

  Add a plain text version of the IAX2 security document.
........

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

15 years agoBlocked revisions 216087 via svnmerge
Russell Bryant [Thu, 3 Sep 2009 19:37:19 +0000 (19:37 +0000)] 
Blocked revisions 216087 via svnmerge

........
  r216087 | russell | 2009-09-03 14:37:05 -0500 (Thu, 03 Sep 2009) | 2 lines

  Fix a typo.
........

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

15 years agoMerged revisions 216080 via svnmerge from
Russell Bryant [Thu, 3 Sep 2009 19:36:46 +0000 (19:36 +0000)] 
Merged revisions 216080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r216080 | russell | 2009-09-03 14:35:23 -0500 (Thu, 03 Sep 2009) | 2 lines

  Add a note about IAX2 to UPGRADE.txt.
........

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

15 years agoMerged revisions 216005 via svnmerge from
Russell Bryant [Thu, 3 Sep 2009 18:44:58 +0000 (18:44 +0000)] 
Merged revisions 216005 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r216005 | russell | 2009-09-03 13:42:24 -0500 (Thu, 03 Sep 2009) | 2 lines

  Add IAX2 security document related to AST-2009-006.
........

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

15 years agoMerge code associated with AST-2009-006
David Vossel [Thu, 3 Sep 2009 18:32:32 +0000 (18:32 +0000)] 
Merge code associated with AST-2009-006

(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks

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

15 years agoRe-send non-100 provisional responses to prevent cancellation
Terry Wilson [Wed, 2 Sep 2009 21:41:22 +0000 (21:41 +0000)] 
Re-send non-100 provisional responses to prevent cancellation

From section 13.3.1.1 of RFC 3261:

   If the UAS desires an extended period of time to answer the INVITE,
   it will need to ask for an "extension" in order to prevent proxies
   from canceling the transaction. A proxy has the option of canceling
   a transaction when there is a gap of 3 minutes between responses in a
   transaction. To prevent cancellation, the UAS MUST send a non-100
   provisional response at every minute, to handle the possibility of
   lost provisional responses.

(closes issue #11157)
Reported by: rjain
Tested by: twilson

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

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

15 years agoUse strrchr() so SoftHangup will correctly truncate multi-hyphen channel names
Dwayne M. Hubbard [Tue, 1 Sep 2009 23:04:52 +0000 (23:04 +0000)] 
Use strrchr() so SoftHangup will correctly truncate multi-hyphen channel names

In general channel names are in the form Foo/Bar-Z, but the channel name
could have multiple hyphens and look like Foo/B-a-r-Z.  Use strrchr to
truncate the channel name at the last hyphen.

(closes issue #15810)
Reported by: dhubbard
Patches:
      dw-softhangup-1.4.patch uploaded by dhubbard (license 733)

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

15 years agoAlso unlock the "other" channel, when returning, due to glare.
Tilghman Lesher [Mon, 31 Aug 2009 16:16:52 +0000 (16:16 +0000)] 
Also unlock the "other" channel, when returning, due to glare.
(closes issue #15787)
 Reported by: tim_ringenbach
 Patches:
       chan_local.diff uploaded by tim ringenbach (license 540)
 Tested by: tim_ringenbach

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

15 years agoModify comment to be a bit more accurate.
Tilghman Lesher [Fri, 28 Aug 2009 20:13:32 +0000 (20:13 +0000)] 
Modify comment to be a bit more accurate.
We have kept this comment around long enough, that it's pretty clear that we're
keeping the code, because changing the code would require a pretty fundamental
architectural shift.  We've also taken criticism in some quarters, because it
was believed that it was referring to the code being nasty.  No, the code isn't
nasty, just the operation itself is rather odd.  Fixed for eternity (probably
not).

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

15 years agoUse autoconf to detect libcurl, as this enables cross-compilation checks, something...
Tilghman Lesher [Thu, 27 Aug 2009 21:45:34 +0000 (21:45 +0000)] 
Use autoconf to detect libcurl, as this enables cross-compilation checks, something we didn't allow before.
(closes issue #15714)
 Reported by: pprindeville
 Patches:
       20090813__issue15714.diff.txt uploaded by tilghman (license 14)
 Tested by: pprindeville

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

15 years agoOne more build system change, to make the descriptions look better, if we have better...
Tilghman Lesher [Thu, 27 Aug 2009 16:53:58 +0000 (16:53 +0000)] 
One more build system change, to make the descriptions look better, if we have better information.

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

15 years agoMake autoheader descriptions render correctly in our autoconfig.h file.
Tilghman Lesher [Thu, 27 Aug 2009 16:03:50 +0000 (16:03 +0000)] 
Make autoheader descriptions render correctly in our autoconfig.h file.
(Figured out while working with issue #14906)

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

15 years agoast_write() ignores ast_audiohook_write() results
David Vossel [Wed, 26 Aug 2009 16:36:42 +0000 (16:36 +0000)] 
ast_write() ignores ast_audiohook_write() results

In ast_write(), if a channel has a list of audiohooks, those
lists are written to and the resulting frame is what ast_write()
should continue with.  The problem was the returned audiohook frame
was not being handled at all, and the original frame passed
into it did not contain the mixed audio, so essentially audio
was being lost.  One result of this was chan_spy's whisper
mode no longer worked.  To complicate the issue, frames
passed into ast_write may either be a single frame, or a list
of frames.  So, as the list of frames is processed in the
audiohook_write, the returned frames had to be added to a new
list.

(closes issue #15660)
Reported by: corruptor
Tested by: dvossel

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

15 years agoI should always compile before committing...
Tilghman Lesher [Tue, 25 Aug 2009 19:28:42 +0000 (19:28 +0000)] 
I should always compile before committing...

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

15 years agoFix pronunciation of German dates.
Tilghman Lesher [Tue, 25 Aug 2009 19:26:50 +0000 (19:26 +0000)] 
Fix pronunciation of German dates.
(closes issue #15273)
 Reported by: Benjamin Kluck
 Patches:
       say_c.patch uploaded by Benjamin Kluck (license 803)

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

15 years agoImprove error message by informing user exactly which function is missing a parethesis.
Tilghman Lesher [Tue, 25 Aug 2009 06:34:44 +0000 (06:34 +0000)] 
Improve error message by informing user exactly which function is missing a parethesis.
(closes issue #15242)
 Reported by: Nick_Lewis
 Patches:
       pbx.c-funcparenthesis.patch2 uploaded by dbrooks (license 790)
       pbx.c-funcparenthesis-1.4.diff uploaded by loloski (license 68)

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

15 years agoUse the default runlevels for Debian derivatives, instead of making up our own.
Tilghman Lesher [Tue, 25 Aug 2009 02:40:22 +0000 (02:40 +0000)] 
Use the default runlevels for Debian derivatives, instead of making up our own.
(closes issue #14730)
 Reported by: pkempgen

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

15 years agoEnsure that T.38 INVITEs generated by Asterisk properly result in T.38 being enabled.
Kevin P. Fleming [Fri, 21 Aug 2009 20:23:45 +0000 (20:23 +0000)] 
Ensure that T.38 INVITEs generated by Asterisk properly result in T.38 being enabled.

(closes issue #15373)
Reported by: dcolombo
Patches:
      chan_sip.patch uploaded by mbrancaleoni (license 342)
Tested by: dcolombo, mbrancaleoni

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

15 years agoPermit DEBUG_FD_LEAKS to be used with C++ source files.
Tilghman Lesher [Fri, 21 Aug 2009 16:52:53 +0000 (16:52 +0000)] 
Permit DEBUG_FD_LEAKS to be used with C++ source files.
(closes issue #15698)
 Reported by: slavon
 Patches:
       20090817__issue15698.diff.txt uploaded by tilghman (license 14)
 Tested by: slavon, tilghman

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

15 years agoClarify queues.conf comments to specify that variables should be set in the dialplan.
Jason Parker [Fri, 21 Aug 2009 16:03:21 +0000 (16:03 +0000)] 
Clarify queues.conf comments to specify that variables should be set in the dialplan.

(closes issue #15755)
Reported by: trendboy

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

15 years agoFix a crash by checking the proper pointer for validity before deferencing it.
Matthew Nicholson [Thu, 20 Aug 2009 20:33:07 +0000 (20:33 +0000)] 
Fix a crash by checking the proper pointer for validity before deferencing it.

(closes issue #15751)
Reported by: atis
Patches:
      ast_bridge_call_peer_cdr.patch uploaded by atis (license 242)

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

15 years agoMake all the symbols for the C-client callbacks global
Jeff Peeler [Thu, 20 Aug 2009 19:53:34 +0000 (19:53 +0000)] 
Make all the symbols for the C-client callbacks global

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

15 years agoFixes memory leak caused by incorrectly freeing mixmonitor
David Vossel [Wed, 19 Aug 2009 21:18:37 +0000 (21:18 +0000)] 
Fixes memory leak caused by incorrectly freeing mixmonitor

(closes issue #15699)
Reported by: edantie
Patches:
      mixmonitor.patch uploaded by edantie (license 862)

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

15 years agoConvert this branch to Opsound music-on-hold.
Kevin P. Fleming [Tue, 18 Aug 2009 20:26:53 +0000 (20:26 +0000)] 
Convert this branch to Opsound music-on-hold.

For more details:
http://blogs.digium.com/2009/08/18/asterisk-music-on-hold-changes/

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

15 years agoDelay the creation of temporary files until we have a valid manager command to handle.
Sean Bright [Tue, 18 Aug 2009 16:36:00 +0000 (16:36 +0000)] 
Delay the creation of temporary files until we have a valid manager command to handle.

Without this patch, asterisk creates a temporary file before determining if the
specified command is valid.  If invalid, we weren't properly cleaning up the file.

(closes issue #15730)
Reported by: zmehmood
Patches:
      M15730.diff uploaded by junky (license 177)
Tested by: zmehmood

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

15 years agoRemoved some deadwood and added some doxygen comments.
Richard Mudgett [Tue, 18 Aug 2009 16:00:56 +0000 (16:00 +0000)] 
Removed some deadwood and added some doxygen comments.

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

15 years agoFix segfault when reloading chan_misdn.
Jeff Peeler [Mon, 17 Aug 2009 16:34:56 +0000 (16:34 +0000)] 
Fix segfault when reloading chan_misdn.

If more ports were specified than configured in misdn.conf a reload would crash
asterisk. The problem was the unconfigured port was using data from the
previously configured port. When the data for an unconfigured port was freed a
crash would result from the double free.

(closes issue #12113)
Reported by: agupta
Patches:
      bug12113.patch uploaded by jpeeler (license 325)

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

15 years agoFix uninitialized variable.
Richard Mudgett [Mon, 17 Aug 2009 15:36:28 +0000 (15:36 +0000)] 
Fix uninitialized variable.

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

15 years agoThis patch adds additional checking when generating queue log TRANSFER events.
Matthew Nicholson [Wed, 12 Aug 2009 23:04:02 +0000 (23:04 +0000)] 
This patch adds additional checking when generating queue log TRANSFER events.

The additional checks prevent generation of false TRANSFER events in certain situations.

(closes issue #14536)
Reported by: aragon
Patches:
      queue-log-xfer-fix1.diff uploaded by mnicholson (license 96)
Tested by: aragon, mnicholson

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

15 years agoBackport fix so that outbound CANCEL requests have same branch as challenged INVITEs.
Mark Michelson [Wed, 12 Aug 2009 18:46:09 +0000 (18:46 +0000)] 
Backport fix so that outbound CANCEL requests have same branch as challenged INVITEs.

There already was code present to be sure that a CANCEL will contain the same branch-id
as the INVITE it is cancelling. However, for INVITES which are challenged downstream,
this mechanism did not work properly. Now this is taken care of.

This is a backport of a fix already present in all 1.6.X branches and in trunk. It also
fixes ABE-1907.

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

16 years agoConversion specifiers, not format specifiers
Tilghman Lesher [Mon, 10 Aug 2009 19:48:48 +0000 (19:48 +0000)] 
Conversion specifiers, not format specifiers

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

16 years agoAST-2009-005
Tilghman Lesher [Mon, 10 Aug 2009 19:15:57 +0000 (19:15 +0000)] 
AST-2009-005

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

16 years agoSmall oops. Clear the flags which have been checked.
Tilghman Lesher [Sun, 9 Aug 2009 15:41:01 +0000 (15:41 +0000)] 
Small oops.  Clear the flags which have been checked.

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

16 years agoResolve a deadlock involving app_chanspy and masquerades.
Russell Bryant [Fri, 7 Aug 2009 20:11:31 +0000 (20:11 +0000)] 
Resolve a deadlock involving app_chanspy and masquerades.

(ABE-1936)

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

16 years agoQUEUE_MEMBER_LIST _really_ wants the interface name, not the membername.
Tilghman Lesher [Fri, 7 Aug 2009 18:16:28 +0000 (18:16 +0000)] 
QUEUE_MEMBER_LIST _really_ wants the interface name, not the membername.

This is a partial revert of revision 82590, which was an attempted cleanup,
but in reality, it broke QUEUE_MEMBER_LIST, which has always been intended
as a method by which component interfaces could be queried from the queue.
Membername isn't useful here, because that field cannot be used to obtain
further information about the member.  See the documentation on
QUEUE_MEMBER_LIST, RemoveQueueMember, QUEUE_MEMBER_PENALTY, and the various
AMI commands which take a member argument for further justification.
(closes issue #15664)
 Reported by: rain
 Patches:
       app_queue-queue_member_list.diff uploaded by rain (license 327)

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

16 years agoBecause channel information can be accessed outside of the channel thread, we must...
Tilghman Lesher [Thu, 6 Aug 2009 21:45:01 +0000 (21:45 +0000)] 
Because channel information can be accessed outside of the channel thread, we must lock the channel prior to modifying it.
(closes issue #15397)
 Reported by: caspy
 Patches:
       20090714__issue15397.diff.txt uploaded by tilghman (license 14)
 Tested by: caspy

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

16 years agoDialplan starts execution before the channel setup is complete.
Richard Mudgett [Wed, 5 Aug 2009 19:18:56 +0000 (19:18 +0000)] 
Dialplan starts execution before the channel setup is complete.

*  Issue 15655: For the case where dialing is complete for an incoming
call, dahdi_new() was asked to start the PBX and then the code set more
channel variables.  If the dialplan hungup before these channel variables
got set, asterisk would likely crash.
*  Fixed potential for overlap incoming call to erroneously set channel
variables as global dialplan variables if the ast_channel structure failed
to get allocated.
*  Added missing set of CALLINGSUBADDR in the dialing is complete case.

(closes issue #15655)
Reported by: alecdavis

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

16 years agoUpdate imapstorage.txt documentation.
Leif Madsen [Wed, 5 Aug 2009 18:46:21 +0000 (18:46 +0000)] 
Update imapstorage.txt documentation.
Updated the imapstorage.txt documentation to reflect that issues with
c-client versions older than 2007 seem to cause crashing issues that
are not seen with more recent versions. Documentation has been updated
to reflect this.

(closes issue #14496)
Reported by: vbcrlfuser
Patches:
      __20090727-imap-documentation-patch.txt uploaded by lmadsen (license 10)
Tested by: lmadsen, mmichelson, dbrooks

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

16 years agoEliminate spurious compiler warnings from system headers on *BSD platforms.
Kevin P. Fleming [Tue, 4 Aug 2009 14:51:39 +0000 (14:51 +0000)] 
Eliminate spurious compiler warnings from system headers on *BSD platforms.

Ensure that system headers located in /usr/local/include are actually treated
as system headers by the compiler, and not as local headers which are subject
to warnings from the -Wundef compiler option and others.

(closes issue #15606)
Reported by: mvanbaak

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

16 years agoFixes dialplan wildcard extension taking precedence over call pickup code.
David Brooks [Mon, 3 Aug 2009 16:15:20 +0000 (16:15 +0000)] 
Fixes dialplan wildcard extension taking precedence over call pickup code.

Prior to this patch, a wildcard extension in the dialplan (for example, _*.) would take
precedence over picking up a call in the channel's pickup group. This patch simply moves
the block of code handling pickup group matching to above the extension matching code.

(closes issue #14735)
Reported by: stevedavies

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

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

16 years agoReverting index() fix, applying a different methodology, based upon developer discuss...
Tilghman Lesher [Mon, 3 Aug 2009 16:11:29 +0000 (16:11 +0000)] 
Reverting index() fix, applying a different methodology, based upon developer discussions.
(related to issue #15639)

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

16 years agoHelps if we export the index() function.
Tilghman Lesher [Mon, 3 Aug 2009 15:42:10 +0000 (15:42 +0000)] 
Helps if we export the index() function.
(Related to issue #15639)

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

16 years agoApparently, some platforms don't have the index() function.
Tilghman Lesher [Mon, 3 Aug 2009 15:39:41 +0000 (15:39 +0000)] 
Apparently, some platforms don't have the index() function.
(closes issue #15639)
 Reported by: nmav

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

16 years agoResolve a valgrind warning about a read from uninitialized memory.
Russell Bryant [Sat, 1 Aug 2009 11:27:25 +0000 (11:27 +0000)] 
Resolve a valgrind warning about a read from uninitialized memory.

(issue #15396)
Reported by: aragon

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

16 years agoModify how Playtones() is used in Milliwatt() to resolve gain issue.
Russell Bryant [Sat, 1 Aug 2009 10:59:05 +0000 (10:59 +0000)] 
Modify how Playtones() is used in Milliwatt() to resolve gain issue.

When Milliwatt() was changed internally to use Playtones() so that the proper
tone was used, it introduced a drop in gain in the output signal.  So, use
the playtones API directly and specify a volume argument such that the output
matches the gain of the original Milliwatt() code.

(closes issue #15386)
Reported by: rue_mohr
Patches:
      issue_15386.rev2.diff uploaded by russell (license 2)
Tested by: rue_mohr

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

16 years agoMinor changes inspired by testing with latest GCC.
Kevin P. Fleming [Sat, 1 Aug 2009 00:52:00 +0000 (00:52 +0000)] 
Minor changes inspired by testing with latest GCC.

The latest GCC (what will become 4.5.x) has a few new warnings, that in these
cases found some either downright buggy code, or at least seriously poorly
designed code that could be improved.

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

16 years agoPublish French extra sounds
Tilghman Lesher [Tue, 28 Jul 2009 00:12:03 +0000 (00:12 +0000)] 
Publish French extra sounds

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

16 years agoAllow for UDPTL to use only even-numbered ports if desired.
Mark Michelson [Mon, 27 Jul 2009 17:44:06 +0000 (17:44 +0000)] 
Allow for UDPTL to use only even-numbered ports if desired.

There are some VoIP providers out there that will not accept SDP
offers with odd numbered UDPTL ports. While it is my personal opinion
that these VoIP providers are misinterpreting RFC 2327, it really is
not a big deal to play along with their silly little games. Of course,
since restricting UDPTL ports to only even numbers reduces the range
of available ports by half, so the option to use only even port numbers
is off by default. A user can enable the behavior by setting
use_even_ports=yes in udptl.conf.

(closes issue #15182)
Reported by: CGMChris
Patches:
      15182.patch uploaded by mmichelson (license 60)
Tested by: CGMChris

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

16 years agobackport rev 205532 from trunk:
Michiel van Baak [Mon, 27 Jul 2009 09:56:13 +0000 (09:56 +0000)] 
backport rev 205532 from trunk:

pthread_self returns a pthread_t which is not an unsigned int on all
pthread implementations. Casting it to an unsigned int fixes compiler warnings.

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

16 years agoFix logic errors from 208746
Jeff Peeler [Mon, 27 Jul 2009 01:18:31 +0000 (01:18 +0000)] 
Fix logic errors from 208746

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

16 years agoFix compiling under dev-mode with gcc 4.4.0.
Jeff Peeler [Sat, 25 Jul 2009 06:19:50 +0000 (06:19 +0000)] 
Fix compiling under dev-mode with gcc 4.4.0.

Mostly trivial changes, but I did not know of any other way to fix the
"dereferencing type-punned pointer will break strict-aliasing rules" error
without creating a tmp variable in chan_skinny.

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

16 years agoDon't impose an arbitrary limit on member lines in queues.conf
Mark Michelson [Fri, 24 Jul 2009 19:24:28 +0000 (19:24 +0000)] 
Don't impose an arbitrary limit on member lines in queues.conf

I know what some of you are thinking: "UGH! Mark, why are you using
ast_strdup and ast_free for the string when you can just use ast_strdupa
and let the memory free itself?! Have the bats been chewing on your brain
again?"

Based on past experiences, I don't like using ast_strdupa inside a loop.
It's a good way to potentially exhaust stack space. Also, since this only
happens when reloading queues, I don't think that heap allocations and
frees are going to be a huge problem.

(closes issue #15559)
Reported by: amorsen

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

16 years agoDo not log an ERROR if autoservice_stop() returns -1.
Russell Bryant [Fri, 24 Jul 2009 18:38:24 +0000 (18:38 +0000)] 
Do not log an ERROR if autoservice_stop() returns -1.

This does not indicate an error.  A return of -1 just means that the channel
has been hung up.

(reported in #asterisk-dev)

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

16 years agoOnly send a BYE when hanging up a channel that is up.
Mark Michelson [Fri, 24 Jul 2009 18:26:50 +0000 (18:26 +0000)] 
Only send a BYE when hanging up a channel that is up.

For cases where Asterisk sends an INVITE and receives a non 2XX final
response, Asterisk would follow the INVITE transaction by immediately
sending a BYE, which was unnecessary.

(closes issue #14575)
Reported by: chris-mac

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

16 years agoFix a problem where a 491 response could be sent out of dialog.
Mark Michelson [Thu, 23 Jul 2009 19:24:21 +0000 (19:24 +0000)] 
Fix a problem where a 491 response could be sent out of dialog.

This generalizes the fix for issue 13849. The initial fix corrected the
problem that Asterisk would reply with a 491 if a reinvite were received
from an endpoint and we had not yet received an ACK from that endpoint
for the initial INVITE it had sent us. This expansion also allows Asterisk
to appropriately handle an INVITE with authorization credentials if Asterisk
had not received an ACK from the previous transaction in which Asterisk had
responded to an unauthorized INVITE with a 407.

(closes issue #14239)
Reported by: klaus3000
Patches:
      14239.patch uploaded by mmichelson (license 60)
Tested by: klaus3000

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

16 years agoOnly set the priindication setting when not performing a reload
Jeff Peeler [Thu, 23 Jul 2009 19:19:53 +0000 (19:19 +0000)] 
Only set the priindication setting when not performing a reload

(closes issue #14696)
Reported by: fdecher

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

16 years agoRemove inaccurate XXX comment.
Mark Michelson [Thu, 23 Jul 2009 16:29:18 +0000 (16:29 +0000)] 
Remove inaccurate XXX comment.

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

16 years agoProperly handle 183 responses which do not contain an SDP.
Mark Michelson [Thu, 23 Jul 2009 15:43:07 +0000 (15:43 +0000)] 
Properly handle 183 responses which do not contain an SDP.

(closes issue #15442)
Reported by: ffloimair
Patches:
      15442.patch uploaded by mmichelson (license 60)
Tested by: tkarl, ffloimair

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

16 years agoExport symbols for functions included in our compatibility headers.
Tilghman Lesher [Wed, 22 Jul 2009 20:23:53 +0000 (20:23 +0000)] 
Export symbols for functions included in our compatibility headers.
(closes issue #15556)
 Reported by: smw1218

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

16 years agoForce an error if a blank is passed to QUOTE (because the documentation states the...
Tilghman Lesher [Tue, 21 Jul 2009 22:38:54 +0000 (22:38 +0000)] 
Force an error if a blank is passed to QUOTE (because the documentation states the argument is not optional).
This change makes URIENCODE and QUOTE behave similarly, since the documentation
states that the argument is not optional, for both.
(closes issue #15439)
 Reported by: pkempgen
 Patches:
       20090706__issue15439.diff.txt uploaded by tilghman (license 14)

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

16 years agoWait for wink before dialing when using E&M wink signaling
Jeff Peeler [Tue, 21 Jul 2009 20:16:55 +0000 (20:16 +0000)] 
Wait for wink before dialing when using E&M wink signaling

There was already code for other signaling types in dahdi_handle_event to
handle dialing if a dial operation dial string was present. Simply add
SIG_EMWINK to the list.

(closes issue #14434)
Reported by: araasch

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

16 years agoRevert r207573, this approach could potentially block for an unacceptable
Jeff Peeler [Tue, 21 Jul 2009 17:15:48 +0000 (17:15 +0000)] 
Revert r207573, this approach could potentially block for an unacceptable
amount of time.

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

16 years agoDocument default timeout for AMI originations.
Mark Michelson [Tue, 21 Jul 2009 14:26:00 +0000 (14:26 +0000)] 
Document default timeout for AMI originations.

AST-224

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

16 years agoEnsure that user-provided CFLAGS and LDFLAGS are honored.
Kevin P. Fleming [Tue, 21 Jul 2009 13:04:44 +0000 (13:04 +0000)] 
Ensure that user-provided CFLAGS and LDFLAGS are honored.

This commit changes the build system so that user-provided flags (in ASTCFLAGS
and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided
by the build system itself, so that the user can effectively override the
build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now
be provided *either* in the environment before running 'make', or as variable
assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS
is no longer necessary, so they are no longer documented, but are still supported
so as not to break existing build systems that supply them when building Asterisk.

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

16 years agoWait for wink before dialing when using E&M wink signaling
Jeff Peeler [Mon, 20 Jul 2009 23:23:18 +0000 (23:23 +0000)] 
Wait for wink before dialing when using E&M wink signaling

This patch adds a new dahdi_wait function to specifically wait for the wink
event. If the wink is not eventually received the channel is hung up.

(closes issue #14434)
Reported by: araasch
Patches:
      emwinkmod uploaded by araasch (license 693)

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

16 years agoAnswer video SDP offers properly when videosupport is not enabled.
Mark Michelson [Mon, 20 Jul 2009 19:39:59 +0000 (19:39 +0000)] 
Answer video SDP offers properly when videosupport is not enabled.

Copied from Review board:

In issue 12434, the reporter describes a situation in which audio and video
is offered on the call, but because videosupport is disabled in sip.conf,
Asterisk gives no response at all to the video offer. According to RFC 3264,
all media offers should have a corresponding answer. For offers we do not
intend to actually reply to with meaningful values, we should still reply
with the port for the media stream set to 0.

In this patch, we take note of what types of media have been offered and
save the information on the sip_pvt. The SDP in the response will take into
account whether media was offered. If we are not otherwise going to answer
a media offer, we will insert an appropriate m= line with the port set to 0.

It is important to note that this patch is pretty much a bandage being
applied to a broken bone. The patch *only* helps for situations where video
is offered but videosupport is disabled and when udptl_pt is disabled but
T.38 is offered. Asterisk is not guaranteed to respond to every media offer.
Notable cases are when multiple streams of the same type are offered.
The 2 media stream limit is still present with this patch, too.

In trunk and the 1.6.X branches, things will be a bit different since Asterisk
also supports text in SDPs as well.

(closes issue #12434)
Reported by: mnnojd

Review: https://reviewboard.asterisk.org/r/311
Review: https://reviewboard.asterisk.org/r/313

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

16 years agoOnly do the chan->fdno check in ast_read() in a developer build.
Russell Bryant [Mon, 20 Jul 2009 16:26:24 +0000 (16:26 +0000)] 
Only do the chan->fdno check in ast_read() in a developer build.

I changed this check to only happen in a dev-mode build.  I also added a
comment explaining what is going on.  I also made it so that detection of
this situation does not affect ast_read() operation.

(closes issue #14723)
Reported by: seadweller

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

16 years agoFix format specifier to print out an unsigned long long.
Jeff Peeler [Fri, 17 Jul 2009 19:36:19 +0000 (19:36 +0000)] 
Fix format specifier to print out an unsigned long long.

Yep, it's even ifdefed out code. But it made it to the RR list...

(closes issue #14726)
Reported by: lmadsen

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

16 years agoEnhance configuration option for overlapdial allowing direction choice
Jeff Peeler [Fri, 17 Jul 2009 19:13:27 +0000 (19:13 +0000)] 
Enhance configuration option for overlapdial allowing direction choice

Previously overlap dialing could only be turned on or off for both incoming and
outgoing calls. New parameters incoming, outgoing, and both have been added to
allow further control. There is no change in default behavior with these new
options and allows in band DTMF to be accepted in one direction if required.

(closes issue #14471)
Reported by: eboscani

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

16 years agosip option flags handled incorrectly
David Vossel [Fri, 17 Jul 2009 18:00:38 +0000 (18:00 +0000)] 
sip option flags handled incorrectly

(issue #15376)

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

16 years agoSIP incorrect From: header information when callpres is prohib
David Vossel [Fri, 17 Jul 2009 16:05:06 +0000 (16:05 +0000)] 
SIP incorrect From: header information when callpres is prohib

Some ITSP make use of the "Anonymous" display name to detect a
requirement to withhold caller id across the PSTN. This does
not work if the display name is "Unknown".

(closes issue #14465)
Reported by: Nick_Lewis
Patches:
      chan_sip.c-callerpres.patch uploaded by Nick (license 657)
      chan_sip.c-callerpres_trunk.patch uploaded by dvossel (license 671)
Tested by: Nick_Lewis, dvossel

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

16 years agoerror in iax.conf related IP-based access control
David Vossel [Thu, 16 Jul 2009 21:33:19 +0000 (21:33 +0000)] 
error in iax.conf related IP-based access control

(closes issue #15518)
Reported by: pkempgen

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

16 years agoavoid segfault caused by user error
David Vossel [Thu, 16 Jul 2009 21:24:16 +0000 (21:24 +0000)] 
avoid segfault caused by user error

If the CALLERPRES() dialplan function is set to nothing,
a segfault occurs.  This is user error to begin with, but
I'd rather see a cli warning message than have Asterisk
crash on me.

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

16 years agoFix a memory leak.
Tilghman Lesher [Thu, 16 Jul 2009 16:27:35 +0000 (16:27 +0000)] 
Fix a memory leak.
(closes issue #15517)
 Reported by: adomjan
 Patches:
       func_realtime.c-ast_variable_destroy.diff uploaded by adomjan (license 487)

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

16 years agoMerged revision 206700 from
Richard Mudgett [Wed, 15 Jul 2009 20:44:55 +0000 (20:44 +0000)] 
Merged revision 206700 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.2-...

..........
  Fixed chan_misdn crash because mISDNuser library is not thread safe.

  With Asterisk the mISDNuser library is driven by two threads concurrently:
  1. channels/misdn/isdn_lib.c::manager_event_handler()
  2. channels/misdn/isdn_lib.c::misdn_lib_isdn_event_catcher()

  Calls into the library are done concurrently and recursively from
  isdn_lib.c.

  Both threads can fiddle with the master/child layer3_proc_t lists.  One
  thread may traverse the list when the other interrupts it and then removes
  the list element which the first thread was currently handling.  This is
  exactly what caused the crash.  About 60 calls were needed to a Gigaset
  CX475 before it occurred once.

  This patch adds locking when calling into the mISDNuser library.
  This also fixes some cb_log calls with wrong port parameter.

  JIRA ABE-1913
      Patches: misdn-locking.patch (Modified with mostly cosmetic changes)
..........

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

16 years agoOnly print debug info in codec_dahdi if we are asking for it.
Sean Bright [Wed, 15 Jul 2009 15:57:51 +0000 (15:57 +0000)] 
Only print debug info in codec_dahdi if we are asking for it.

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

16 years agoFixes several call transfer issues with chan_misdn.
Richard Mudgett [Tue, 14 Jul 2009 16:44:47 +0000 (16:44 +0000)] 
Fixes several call transfer issues with chan_misdn.

*  issue #14355 - Crash if attempt to transfer a call to an application.
Masquerade the other pair of the four asterisk channels involved in the
two calls.  The held call already must be a bridged call (not an
applicaton) or it would have been rejected.

*  issue #14692 - Held calls are not automatically cleared after transfer.
Allow the core to initate disconnect of held calls to the ISDN port.  This
also fixes a similar case where the party on hold hangs up before being
transferred or taken off hold.

*  JIRA ABE-1903 - Orphaned held calls left in music-on-hold.
Do not simply block passing the hangup event on held calls to asterisk
core.

*  Fixed to allow held calls to be transferred to ringing calls.
Previously, held calls could only be transferred to connected calls.
*  Eliminated unused call states to simplify hangup code.
*  Eliminated most uses of "holded" because it is not a word.

(closes issue #14355)
(closes issue #14692)
Reported by: sodom
Patches:
      misdn_xfer_v14_r205839.patch uploaded by rmudgett (license 664)
Tested by: rmudgett

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

16 years agoMerged revisions 206384 via svnmerge from
Russell Bryant [Tue, 14 Jul 2009 14:48:00 +0000 (14:48 +0000)] 
Merged revisions 206384 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r206384 | russell | 2009-07-14 09:45:47 -0500 (Tue, 14 Jul 2009) | 6 lines

  Ensure apathetic replies are sent out on the proper socket.

  chan_iax2 supports multiple address bindings.  The send_apathetic_reply()
  function did not attempt to send its response on the same socket that the
  incoming message came in on.
........

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

16 years agoFix some memory leaks in chan_misdn.
Richard Mudgett [Tue, 14 Jul 2009 00:17:28 +0000 (00:17 +0000)] 
Fix some memory leaks in chan_misdn.

JIRA ABE-1911

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

16 years agoPrint CID match in "show dialplan".
Russell Bryant [Mon, 13 Jul 2009 15:12:08 +0000 (15:12 +0000)] 
Print CID match in "show dialplan".

(closes issue #14702)
Reported by: klaus3000
Patches:
      patch_asterisk_1.4.23_CID_matching.txt uploaded by klaus3000 (license 65)

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

16 years agoProperly ACK 487 responses to canceled INVITEs.
Mark Michelson [Fri, 10 Jul 2009 17:39:13 +0000 (17:39 +0000)] 
Properly ACK 487 responses to canceled INVITEs.

From the review board request:
The fix from review 298 has exposed a new bug in chan_sip.

When we hang up an outgoing call, we first will dump all the outstanding
packets on the sip_pvt using __sip_pretend_ack. Then, if we can, we send
a CANCEL. The problem with this is that since destroyed all the outstanding
packets on the dialog, we cannot match the incoming 487 response to our
INVITE. Because we cannot match the response, we do not send an ACK.

To correct this, instead of using __sip_pretend_ack, I have changed the code
to loop through the list of packets and call __sip_semi_ack on each one
instead. This causes us to stop retransmitting the requests, but we still have
them around in case we get responses for them.

When discussing this earlier today with Josh Colp, we both agreed that in the
majority of cases, this would be enough of a fix. However, we also agreed that
we should have a safety net in place in case we never receive a response to
our initial INVITE. To handle this, I have modified __sip_autodestruct to
behave similar to the way it does in Asterisk 1.4. If there are outstanding
packets on the sip_pvt, the needdestroy flag is not set, and the last request
on the dialog was either a CANCEL or BYE, then we set the needdestroy flag and
reschedule destruction for 10 seconds in the future. If, though, the
needdestroy flag is set, then we use __sip_pretend_ack to kill the remaining
outstanding packets so that the monitor thread can destroy the sip_pvt.

I ran two separate tests. First, I placed a call from my Aastra phone to my
Polycom phone. I hung up the Aastra before the Polycom answered. I verified
through sip debug output that Asterisk properly ACKed the 487 received from the
Polycom.

For my second test, I set up a SIPp UAS scenario so that it would send a 200 OK
in response to a CANCEL but would not send a 487 for the original INVITE. I
verified that after about 40 seconds, Asterisk properly cleans up the outgoing
sip_pvt for the call.

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

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

16 years agoSIP registration auth loop caused by stale nonce
David Vossel [Fri, 10 Jul 2009 16:23:59 +0000 (16:23 +0000)] 
SIP registration auth loop caused by stale nonce

If an endpoint sends two registration requests in a very short
period of time with the same nonce, both receive 401 responses
from Asterisk, each with a different nonce (the second 401
containing the current nonce and the first one being stale).
If the endpoint responds to the first 401, it does not match
the current nonce so Asterisk sends a third 401 with a newly
generated nonce (which updates the current nonce)... Now if
the endpoint responds to the second 401, it does not match the
current nonce either and Asterisk sends a fourth 401 with a
newly generated nonce... This loop goes on and on.

There appears to be a simple fix for this.  If the nonce from
the request does not match our nonce, but is a good response
to a previous nonce, instead of sending a 401 with a newly
generated nonce, use the current one instead.  This breaks
the loop as the nonce is not updated until a response is
received. Additional logic has been added to make sure no
nonce can be responded to twice though.

(closes issue #15102)
Reported by: Jamuel
Patches:
      patch-bug_0015102 uploaded by Jamuel (license 809)
      nonce_sip.diff uploaded by dvossel (license 671)
Tested by: Jamuel

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

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

16 years agoEnsure that outbound NOTIFY requests are properly routed through stateful proxies.
Mark Michelson [Fri, 10 Jul 2009 15:51:36 +0000 (15:51 +0000)] 
Ensure that outbound NOTIFY requests are properly routed through stateful proxies.

With this change, we make note of Record-Route headers present in any SUBSCRIBE
request that we receive so that our outbound NOTIFY requests will have the proper
Route headers in them.

(closes issue #14725)
Reported by: ibc

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

16 years agoNo audio on calls from Asterisk to various ISDN devices until DTMF sent by caller.
Richard Mudgett [Thu, 9 Jul 2009 23:37:53 +0000 (23:37 +0000)] 
No audio on calls from Asterisk to various ISDN devices until DTMF sent by caller.

Add missing clearing of the dialing flag when the ISDN call is CONNECTED.
(i.e. When libpri generates the event PRI_EVENT_ANSWER.)

(closes issue #15420)
Reported by: scottbmilne
Patches:
      bug15420-1.4.25.1-diff2.txt uploaded by alecdavis (license 585)
Tested by: scottbmilne, alecdavis

(closes issue #15416)
Reported by: avinoash

(closes issue #15389)
Reported by: alecdavis

This patch should also fix the following issue:
(issue #15205)
Reported by: vinsik

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

16 years agoChanging ast_samp2tv to not use floating point.
David Vossel [Thu, 9 Jul 2009 16:18:09 +0000 (16:18 +0000)] 
Changing ast_samp2tv to not use floating point.

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

16 years agoFixes 8khz assumptions
David Vossel [Wed, 8 Jul 2009 23:15:54 +0000 (23:15 +0000)] 
Fixes 8khz assumptions

Many calculations assume 8khz is the codec rate. This
is not always the case.  This patch only addresses chan_iax.c
and res_rtp_asterisk.c, but I am sure there are other areas
that make this assumption as well.

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

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

16 years agomoving ast_devstate_to_extenstate to pbx.c from devicestate.c
David Vossel [Wed, 8 Jul 2009 21:35:12 +0000 (21:35 +0000)] 
moving ast_devstate_to_extenstate to pbx.c from devicestate.c

ast_devstate_to_extenstate belongs in pbx.c.  This change
fixes a compile time error with chan_vpb as well.

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

16 years agoPrevent phantom calls to queue members.
Mark Michelson [Wed, 8 Jul 2009 19:26:13 +0000 (19:26 +0000)] 
Prevent phantom calls to queue members.

If a caller were to hang up while a periodic announcement or position
were being said, the return value for those functions would incorrectly
indicate that the caller was still in the queue. With these changes,
the problem does not occur.

(closes issue #14631)
Reported by: latinsud
Patches:
      queue_announce_ghost_call2.diff uploaded by latinsud (license 745)
  (with small modification from me)

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

16 years agoUpdate config.guess and config.sub from the savannah.gnu.org git repo.
Jason Parker [Wed, 8 Jul 2009 18:19:03 +0000 (18:19 +0000)] 
Update config.guess and config.sub from the savannah.gnu.org git repo.

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

16 years agoast_samp2tv needs floating point for 16khz audio
David Vossel [Wed, 8 Jul 2009 16:53:40 +0000 (16:53 +0000)] 
ast_samp2tv needs floating point for 16khz audio

In ast_samp2tv(), (1000000 / _rate) = 62.5 when _rate is 16000.
The .5 is currently stripped off because we don't calculate
using floating points.  This causes madness with 16khz audio.

(issue ABE-1899)

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

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

16 years agoAdd redirection warnings for the invalid language codes previously removed.
Tilghman Lesher [Wed, 8 Jul 2009 16:26:15 +0000 (16:26 +0000)] 
Add redirection warnings for the invalid language codes previously removed.

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

16 years agoMake OpenSSL usage thread-safe.
Russell Bryant [Wed, 8 Jul 2009 15:54:21 +0000 (15:54 +0000)] 
Make OpenSSL usage thread-safe.

OpenSSL is not thread-safe by default.  However, making it thread safe is
very easy.  We just have to provide a couple of callbacks.  One callback
returns a thread ID.  The other handles locking.  For more information,
start with the "Is OpenSSL thread-safe?" question on the FAQ page of
openssl.org.

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

16 years agoRemoved confusing warning message "Got Busy in Connected State"
Richard Mudgett [Thu, 2 Jul 2009 21:59:43 +0000 (21:59 +0000)] 
Removed confusing warning message "Got Busy in Connected State"

If an incoming mISDN call is answered with the Answer application and a
subsequent Dial gets a busy endpoint then it is valid for that already
connected channel to get the busy indication.  Asterisk will play the busy
tones until the dialplan plays something else or hangs up the call.

(closes issue #11974)
Reported by: fvdb

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

16 years agomoving device state functions from pbx.h to devicestate.h to sync with other branches
David Vossel [Thu, 2 Jul 2009 18:15:39 +0000 (18:15 +0000)] 
moving device state functions from pbx.h to devicestate.h to sync with other branches

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

16 years agoImproved mapping of extension states from combined device states.
David Vossel [Thu, 2 Jul 2009 15:05:57 +0000 (15:05 +0000)] 
Improved mapping of extension states from combined device states.

This fixes a few issues with incorrect extension states and adds
a cli command, core show device2extenstate, to display all possible
state mappings.

(closes issue #15413)
Reported by: legart
Patches:
      exten_helper.diff uploaded by dvossel (license 671)
Tested by: dvossel, legart, amilcar

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

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

16 years agoMore incorrect language codes, plus ensuring that regionalizations use the specified...
Tilghman Lesher [Tue, 30 Jun 2009 20:23:51 +0000 (20:23 +0000)] 
More incorrect language codes, plus ensuring that regionalizations use the specified language, and not English for grammar.
(closes issue #15022)
 Reported by: greenfieldtech
 Patches:
       20090519__issue15022.diff.txt uploaded by tilghman (license 14)

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

16 years agoFix ast_say_counted_noun to correctly handle Polish. Fix a comment typo in passing.
Jason Parker [Tue, 30 Jun 2009 18:47:06 +0000 (18:47 +0000)] 
Fix ast_say_counted_noun to correctly handle Polish.  Fix a comment typo in passing.

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