dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

2753 Commits

Author SHA1 Message Date
seanbright 62fe2d93d1 Fix ao2_callback when both OBJ_MULTIPLE and OBJ_NODATA are passed.
There is an issue which only affects trunk and the new ao2_callback OBJ_MULTIPLE
implementation.  When both OBJ_MULTIPLE and OBJ_NODATA are passed, only the first
object is visited, regardless of what is returned by the specified callback. This
causes a problem when we are clearing a container, i.e.:

    ao2_callback(container, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);

Only unlinks the first object.  This patch resolves this.

(closes issue #16564)
Reported by: pj
Patches:
      issue16564_20100111.diff uploaded by seanbright (license 71)
Tested by: pj, seanbright

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239113 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-11 16:40:23 +00:00
seanbright 76f02e8ea5 Fix spelling of 'category.'
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239111 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-11 16:22:09 +00:00
tilghman 13b87f413f According to POSIX, the capital L modifier applies only to floating point types.
Fixes a crash on Solaris.
(closes issue #16572)
 Reported by: crjw
 Patches: 
       frame_changes.patch uploaded by crjw (license 963)
       Plus several others found and fixed by me


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239074 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-10 19:37:30 +00:00
tilghman b7ec076367 It's been long enough -- make the behavior introduced in 1.6 the default.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239000 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-10 06:56:36 +00:00
tilghman 070bfb9327 Merged revisions 238915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238915 | tilghman | 2010-01-08 18:57:58 -0600 (Fri, 08 Jan 2010) | 6 lines
  
  -1 is interpreted as an error, intead of the maximum mask.
  (closes issue #16241)
   Reported by: vnovy
   Patches: 
         manager.c.patch uploaded by vnovy (license 922)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238916 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-09 01:08:04 +00:00
jpeeler 090335b824 Merged revisions 238834 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238834 | jpeeler | 2010-01-08 17:28:37 -0600 (Fri, 08 Jan 2010) | 4 lines
  
  Stop a crash when no peer is passed to masq_park_call.
  
  (distantly related to issue #16406)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238835 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 23:30:55 +00:00
dvossel a97f411189 fixes AUDIOHOOK_INHERIT regression
During the process of removing an audiohook from one channel
and attaching it to another the audiohook's status is updated
to DONE and then back to whatever it was previously.  Typically
updating the status after setting it to DONE is not a good idea
because DONE can trigger unrecoverable audiohook destruction
events... because of this a conditional check was added to
audiohook_update_status to explicitly prevent the audiohook
from ever changing after being set to DONE.  It was this check
that prevented audiohook inherit from work properly though.

Now ast_audiohook_move_by_source is treated as a special exception,
as the audiohook must be returned to its previous status after
attaching it to the new channel.  This is only a safe operation
because the audiohook's lock is held the entire time, otherwise
this could cause trouble.

(closes issue #16522)
Reported by: corruptor



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238635 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 19:39:30 +00:00
mnicholson 2400d53feb Merged revisions 238629 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238629 | mnicholson | 2010-01-08 13:20:44 -0600 (Fri, 08 Jan 2010) | 5 lines
  
  Properly calculate the remaining space in the output string when reducing format strings.
  
  (closes issue #16560)
  Reported by: goldwein
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238630 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 19:32:11 +00:00
jpeeler a896f4d64a Stop trying to find a parking space after traversing the parkinglot one time.
(closes issue #16428)
Reported by: Yasuhiro Konishi


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238583 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 17:18:41 +00:00
dvossel 76c8a0cc59 fixes ast_transfer stall until hangup if called with a channel that doesn't support transfers
ast_transfer sets res to 0 if there is no technology transfer function,
but then tests for it to be negative before deciding to do an early exit.
As a result, it will will wait for an AST_CONTROL_TRANSFER message that
will never come.

(closes issue #16424)
Reported by: davidw
Patches:
      Issue_16424_trunk_234134.patch uploaded by davidw (license 780)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238492 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-07 20:42:27 +00:00
jpeeler 806dd8ab24 Fix channel name comparison for bridge application.
The channel name comparison was not comparing the whole string and therefore
if one channel name was a substring of the other, the bridge would fail.

(closes issue #16528)
Reported by: telecos82
Patches: 
      res_features_r236843.diff uploaded by telecos82 (license 687)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238134 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-06 19:05:06 +00:00
dvossel ee10f9a749 fixes subscriptions being lost after 'module reload'
During a module reload if multiple extension configs are present,
such as both extensions.conf and extensions.ael, watchers for one
config's hints will be lost during the merging of the other config.

This happens because hint watchers are only preserved for the
current config being merged.  The old context list is destroyed
after the merging takes place, meaning any watchers that were not
perserved will be removed.

Now all hints are preserved during merging regardless of what config
file is being merged.  These hints are only restored if they
are present within the new context list.

(closes issue #16093)
Reported by: jlaroff



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237839 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-05 19:29:47 +00:00
russell 8e1f5b4d31 Fix build of utility apps that include utils.c.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237749 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-05 17:26:50 +00:00
russell e9e7af54ac Merged revisions 237697 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237697 | russell | 2010-01-05 11:13:28 -0600 (Tue, 05 Jan 2010) | 7 lines
  
  Change a NOTICE log message to DEBUG where it belongs.
  
  (closes issue #16479)
  Reported by: alexrecarey
  
  (closes SWP-577)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237699 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-05 17:16:01 +00:00
tilghman af7c89f378 Merged revisions 237573 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237573 | tilghman | 2010-01-04 15:45:46 -0600 (Mon, 04 Jan 2010) | 6 lines
  
  Bounds checking for input string
  (closes issue #16407)
   Reported by: qwell
   Patches: 
         20100104__issue16407.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237574 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 21:48:20 +00:00
tilghman 87a069d76c Merged revisions 237493 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237493 | tilghman | 2010-01-04 14:57:35 -0600 (Mon, 04 Jan 2010) | 8 lines
  
  Regression in issue #15421 - Pattern matching
  (closes issue #16482)
   Reported by: wdoekes
   Patches: 
         astsvn-16482-betterfix.diff uploaded by wdoekes (license 717)
         20091223__issue16482.diff.txt uploaded by tilghman (license 14)
   Tested by: wdoekes, tilghman
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237494 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 20:59:01 +00:00
tilghman ff9204a8b0 Oops, didn't compile (thanks, kpfleming)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237414 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 19:03:20 +00:00
tilghman 0514c0dccd Further reduce the encoded blank values back to blank in the realtime API.
(closes issue #16533)
 Reported by: sergee
 Patches: 
       200100104__issue16533.diff.txt uploaded by tilghman (license 14)
 Tested by: sergee


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237410 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 18:42:10 +00:00
tilghman fda6c101b6 Merged revisions 237405 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237405 | tilghman | 2010-01-04 12:19:00 -0600 (Mon, 04 Jan 2010) | 16 lines
  
  Add a flag to disable the Background behavior, for AGI users.
  This is in a section of code that relates to two other issues, namely
  issue #14011 and issue #14940), one of which was the behavior of
  Background when called with a context argument that matched the current
  context.  This fix broke FreePBX, however, in a post-Dial situation.
  Needless to say, this is an extremely difficult collision of several
  different issues.  While the use of an exception flag is ugly, fixing all
  of the issues linked is rather difficult (although if someone would like
  to propose a better solution, we're happy to entertain that suggestion).
  (closes issue #16434)
   Reported by: rickead2000
   Patches: 
         20091217__issue16434.diff.txt uploaded by tilghman (license 14)
         20091222__issue16434__1.6.1.diff.txt uploaded by tilghman (license 14)
   Tested by: rickead2000
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237406 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 18:28:28 +00:00
qwell a83d55b296 Add app_voicemail and say.c support for Vietnamese.
Also add an XXX comment that I'm baffled nobody has ever complained about.  We
say "first message", and then we go into language-specific stuff where we
proceed to say..."first message".

(closes issue #15053)
Reported by: dinhtrung
Patches:
      vietnamese.ods uploaded by dinhtrung (license 776)
      app_voicemail.c.diff uploaded by dinhtrung (license 776)

(closes issue #15626)
Reported by: dinhtrung
Patches:
      say.c.diff uploaded by dinhtrung (license 776)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237050 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-30 22:30:21 +00:00
jpeeler 5c6045484e Fix compiling with LOW_MEMORY.
Modified handle_verbose to be LOW_MEMORY aware, removed old RTP related code
in chan_sip.

(closes issue #16381)
Reported by: michael_iedema
Patches: 
      ast_complete_source_filename.patch uploaded by michael iedema (license 942)
      modified by me


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236893 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-30 20:34:41 +00:00
qwell 4cf3771b3c Allow "REMAINDER" to function properly in expressions.
(closes issue #16427)
Reported by: wdoekes
Patches:
      ast16-reminder-remainder.patch uploaded by wdoekes (license 717)
Tested by: wdoekes


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236713 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-28 22:09:40 +00:00
dvossel 5d1bac896e Unit Test Framework API
The Unit Test Framework is a new API that manages registration and
execution of unit tests in Asterisk with the purpose of verifying the
operation of C functions.  The Framework consists of a single test
manager accompanied by a list of registered test functions defined
within the code.  A test is defined, registered, and unregistered
from the framework using a set of macros which allow the test code
to only be compiled within asterisk when the TEST_FRAMEWORK flag is
enabled in menuselect.  This allows the test code to exist in the
same file as the C functions it intends to verify.  Registered tests
may be viewed and executed via a set of new CLI commands.  CLI commands
are also present for generating and exporting test results into xml
and txt formats.

For more information and use cases please refer to the documentation
provided at the beginning of the test.h file.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-22 16:09:11 +00:00
kpfleming 09a7be92ae Change all refererences to 1.6.3 to be 1.8, since that will be the next feature release
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235904 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-21 18:51:17 +00:00
tilghman beeccaf94e Merged revisions 235821 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235821 | tilghman | 2009-12-21 10:45:03 -0600 (Mon, 21 Dec 2009) | 8 lines
  
  Send parking lot announcement to the channel which parked the call, not the park-ee.
  (closes issue #16234)
   Reported by: yeshuawatso
   Patches: 
         20091210__issue16234.diff.txt uploaded by tilghman (license 14)
         20091221__issue16234__1.4.diff.txt uploaded by tilghman (license 14)
   Tested by: yeshuawatso
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235822 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-21 17:00:46 +00:00
alecdavis 89832485ff restarts busydetector (if enabled) when DTMF is received after call is bridged.
(closes issue 0016389)
  Reported by: alecdavis
  Tested by: alecdavis
  Patch
    dtmf_busydetector.diff2.txt uploaded by alecdavis (license 585)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235774 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-20 08:22:35 +00:00
jpeeler 9e662bbfaa Merged revisions 235635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235635 | jpeeler | 2009-12-18 16:29:51 -0600 (Fri, 18 Dec 2009) | 48 lines
  
  Correct CDR dispositions for BUSY/FAILED
  
  This patch is simple in that it reorders the disposition defines so that the fix
  for issue 12946 works properly (the default CDR disposition was changed to
  AST_CDR_NOANSWER). Also, the AST_CDR_FLAG_ORIGINATED flag was set in ast_call to
  ensure all CDR records are written.
  
  The side effects of CDR changes are scary, so I'm documenting the test cases
  performed to attempt to catch any regressions. The following tests were all
  performed using 1.4 rev 195881 vs head (235571) + patch:
  
  A calls B
  C calls B (busy)
  Hangup C
  Hangup A
  
  (Both SIP and features)
  A calls B
  A blind transfers to C
  Hangup C
  
  (Both SIP and features)
  A calls B
  A attended transfers to C
  Hangup C
  
  A calls B
  A attended transfers to C (SIP)
  C blind transfers to A (features)
  Hangup A
  
  All of the test scenario CDRs matched.
  
  The following tests were performed just with the patch to ensure proper operation
  (with unanswered=yes):
  
  exten =>s,1,Answer
  exten =>s,n,ResetCDR(w)
  exten =>s,n,ResetCDR(w)
  
  exten =>s,1,ResetCDR(w)
  exten =>s,n,ResetCDR(w)
  
  (closes issue #16180)
  Reported by: aatef
  Patches: 
        bug16180.patch uploaded by jpeeler (license 325)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235660 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-18 22:51:37 +00:00
tilghman 5f15e53772 Merged revisions 235421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235421 | tilghman | 2009-12-17 11:17:51 -0600 (Thu, 17 Dec 2009) | 8 lines
  
  Use context from which Macro is executed, not macro context, if applicable.
  Also, ensure that the extension COULD match, not just that it won't match more.
  (closes issue #16113)
   Reported by: OrNix
   Patches: 
         20091216__issue16113.diff.txt uploaded by tilghman (license 14)
   Tested by: OrNix
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235422 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-17 17:19:08 +00:00
jpeeler 0264354e67 Enhance AMI redirect to allow channels to be redirected to different places.
New parameters ExtraContext, ExtraExtension, and ExtraPriority have been added
to redirect the second channel to a different location. Previously, it was only
possible to redirect both channels to the same place.

(closes issue #15853)
Reported by: haakon
Patches:
      trunk-manager.c.patch uploaded by haakon (license 880)
Tested by: jpeeler


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235265 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-16 00:31:53 +00:00
jpeeler 1a89b27254 Change match criteria existence in ast_channel_cmp_cb to use ast_strlen_zero.
(closes issue #16161)
Reported by: may213
Patches: 
      core-show-channel.patch uploaded by may213 (license 454)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235226 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15 23:41:20 +00:00
alecdavis 0a038fc649 Whitespace.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@234940 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15 03:26:49 +00:00
alecdavis 932b9ff0b2 restarts busydetector (if enabled) when DTMF is received.
(closes issue #16389)
  Reported by: alecdavis
  Tested by: alecdavis
  Patch
	dtmf_busydetector.diff.txt uploaded by alecdavis (license 585)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@234897 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15 03:04:59 +00:00
seanbright c3a0b4fa52 The default rate for 'timing test' is actually 50/sec, not 100/sec as advertised.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@234572 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-14 16:08:09 +00:00
tilghman 9a6e6a6b16 Trim leading/trailing spaces from the filename, to deal with common user error.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@234458 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-13 09:41:43 +00:00
jpeeler 85b106c45c Add audio announcement option to app_page
As described in the CHANGES file:
* MeetMe has a new option 'G' to play an announcement before joining a
  conference.
* Page has a new option 'A(x)' which will playback an announcement 
  simultaneously to all paged phones (and optionally excluding the caller's one 
  using the new option 'n') before the call is bridged.

To add the new option to meetme, the conference flag options had to be extended 
to 64 bits.

(closes issue #14365)
Reported by: dferrer
Patches:
      page_announce.patch uploaded by dferrer (license 525)
      modified by me

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@234173 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-10 17:31:23 +00:00
dvossel 9f320becac fixes incorrect logic in ast_uri_encode
issue #16299


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233611 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-07 23:28:51 +00:00
tilghman 7c77f7803f Move implementation of closefrom(3) from app.c to strcompat.c
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233358 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-06 07:01:06 +00:00
tilghman b9fbe03d18 Using the builtin function breaks OpenBSD 4.2
(closes issue #16395)
 Reported by: jtodd


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233239 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04 21:06:22 +00:00
russell 64c3f33340 Merged revisions 233092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r233092 | russell | 2009-12-04 11:12:47 -0600 (Fri, 04 Dec 2009) | 7 lines
  
  Only do frame payload check for HOLD frames.
  
  This code was added for helping to debug the source of invalid HOLD frames.
  However, a side effect of this is that it will incorrectly report errors for
  frames that have an integer payload.  Make the check for this block specific
  to the HOLD frame case.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233100 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04 17:18:22 +00:00
mnick 7a9301cf8f Merged revisions 233014 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r233014 | mnick | 2009-12-04 09:17:03 -0600 (Fri, 04 Dec 2009) | 11 lines
  
  Warning message gets displayed only once
  
  Added additional field 'int display_inband_dtmf_warning', which when set to '1' displays the warning ('Inband DTMF is not supported on codec %s. Use RFC2833'), and when set to '0' doesn't display the warning. Otherwise you would get hundreds of warnings every second.
  
  (closes issue #15769)
  Reported by: falves11
  Patches:
  	patch_15769_14.txt uploaded by mnick (license 874)
  Tested by: mnick, falves11
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233046 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04 15:38:33 +00:00
jpeeler ac94073dc1 Merged revisions 232581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232581 | jpeeler | 2009-12-02 15:57:42 -0600 (Wed, 02 Dec 2009) | 7 lines
  
  Send ack (response/message) after receiving manager action userevent
  
  (closes issue #16264)
  Reported by: dimas
  Patches: 
        event-ack.patch uploaded by dimas (license 88)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232582 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 22:02:43 +00:00
jpeeler 08f1971fbf Make manager response to "Action: events" finish with empty line
(closes issue #16275)
Reported by: vnovy
Patches: 
      manager.c.diff uploaded by vnovy (license 922)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232576 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 21:32:50 +00:00
file 466ea98f2a Add an 'X' option to the asterisk application which enables #exec for configuration files.
This option can be used to enable #exec support in the asterisk.conf configuration file.

(closes issue #16260)
Reported by: atis
Patches:
      exec_includes.patch uploaded by atis (license 242)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232510 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 20:10:07 +00:00
dvossel a0342a6557 Merged revisions 232350 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232350 | dvossel | 2009-12-02 10:59:18 -0600 (Wed, 02 Dec 2009) | 6 lines
  
  ast_outaddrfor doesn't do htons() on port, looks odd in strace.
  
  (closes issue #16290)
  Reported by: wdoekes
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232351 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 17:00:15 +00:00
tilghman 9b24e69df6 So apparently, some platforms don't have ffsll(3).
The manpage lies; it says that the function is in POSIX, but that's only for
ffs(3), not ffsll(3).


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232164 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 03:26:16 +00:00
russell 0ff9b6558a Use __builtin_ffsll() from gcc instead of ffssll() to fix a FreeBSD build error.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232017 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 23:56:14 +00:00
russell 1c6712eb5d Merged revisions 232007 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232007 | russell | 2009-12-01 17:25:36 -0600 (Tue, 01 Dec 2009) | 2 lines
  
  Fix a warning pointed out by buildbot.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232008 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 23:27:53 +00:00
jpeeler f049629b4c Merged revisions 231911 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231911 | jpeeler | 2009-12-01 15:29:31 -0600 (Tue, 01 Dec 2009) | 12 lines
  
  Fix crash with invalid frame data
  
  The crash was happening as a result of a frame containing an invalid data
  pointer, but was set with data length of zero. The few times the issue was
  reproduced it _seemed_ that the frame was queued properly, that is the data
  pointer was set to NULL. I never could reproduce the crash so as a last resort
  the crash has been fixed, but a check in __ast_read has been added to give as
  much information about the source of problematic frames in the future.
  
  (closes issue #16058)
  Reported by: atis
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231927 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 21:54:21 +00:00
dvossel 574839b949 Merged revisions 231853 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231853 | dvossel | 2009-12-01 15:14:31 -0600 (Tue, 01 Dec 2009) | 3 lines
  
  WaitExten m option with no parameters generates frame with zero datalen but non-null data ptr
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231867 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 21:20:19 +00:00
tilghman f4d89e410a More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we
found several unhandled cases, where a 32-bit integer was still being used to
handle a codec field.  Most of these have been fixed with this commit, although
there is at least one case (codec_dahdi) which depends upon outside headers to
be altered before a conversion can be made.
(Fixes AST-278, SWP-459)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231850 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 20:27:37 +00:00
mnicholson 8837c68508 Merged revisions 231740 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231740 | mnicholson | 2009-12-01 09:34:57 -0600 (Tue, 01 Dec 2009) | 2 lines
  
  Ignore unknown formats in ast_format_str_reduce() and return an error if no know formats are found.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231741 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 15:47:36 +00:00
kpfleming 9b2fe661f9 Another round of UDPTL stack fixes/improvements:
1) Allow users of UDPTL stack to associate a character-string tag with a UDPTL
   session, so that log/error/debug messages generated by the UDPTL stack can
   be 'connected' to the endpoint that caused them to be generated.

2) Improve comments (and process) of calculating the far end's maximum IFP size
   when redundancy mode is in use for error correction.

3) When an IFP larger than the calculated 'far max IFP' size is presented for
   writing, truncate it rather than putting in the buffer and allowing the buffer
   to overflow; this will cause the ends to retrain to a lower bit rate that
   produces IFPs of an appropriate size if possible, and if not possible, the
   FAX transfer will fail completely. In these cases, it is due to the one endpoint
   supplying a T38FaxMaxDatagram value that is improperly calculated and is
   too low to be of use; we have configuration options available to override
   this behavior.

4) Eliminate use of T38FaxMaxDatagram value in udptl.conf; it is no longer
   needed.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231692 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:47:42 +00:00
mnicholson 60d1d4196a Merged revisions 231614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231614 | mnicholson | 2009-11-30 15:11:44 -0600 (Mon, 30 Nov 2009) | 8 lines
  
  Remove duplicate entries from voicemail format lists. This prevents app_voicemail from entering an infinite loop when the same format is specified twice in the format list.
  
  (closes issue #15625)
  Reported by: Shagg63
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/429/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231688 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:31:55 +00:00
mnicholson 8531434222 Reverted 231616
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231637 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:21:29 +00:00
mnicholson 7b0b50b4da Merged revisions 231614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231614 | mnicholson | 2009-11-30 15:11:44 -0600 (Mon, 30 Nov 2009) | 8 lines
  
  Remove duplicate entries from voicemail format lists. This prevents app_voicemail from entering an infinite loop when the same format is specified twice in the format list.
  
  (closes issue #15625)
  Reported by: Shagg63
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/429/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231616 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:13:42 +00:00
tilghman 88d3071de9 Export dynamic (weak-linked) symbols correctly.
(closes issue #15193)
 Reported by: eliel
 Patches: 
       20091111__issue15193.diff.txt uploaded by tilghman (license 14)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231439 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 16:53:10 +00:00
tilghman 7326fe3151 Reorder option flags. Change guidelines so that example code is consistent with guidelines
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231369 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-26 02:09:58 +00:00
tilghman 66be8d4964 Merged revisions 231298 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231298 | tilghman | 2009-11-25 16:31:57 -0600 (Wed, 25 Nov 2009) | 2 lines
  
  After a frame duplication failure, unlock the channel before returning.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231299 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-25 22:33:02 +00:00
jpeeler 5230ed12f2 Fix erroneous hangup extension execution
ast_spawn_extension behaves differently from 1.4 in that hangups and extensions
that do not exist do not return an error, whereas in 1.6 it does. This is now 
taken into account so that the AST_FLAG_BRIDGE_HANGUP_RUN flag gets set
properly.

(closes issue #16106)
Reported by: ajohnson
Tested by: ajohnson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231095 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-24 18:50:36 +00:00
mnicholson 1b44ad796b Merged revisions 230627 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230627 | mnicholson | 2009-11-20 14:53:06 -0600 (Fri, 20 Nov 2009) | 8 lines
  
  Copy the peer CDR's userfield to the bridge CDR if it exists.  This is necessary for the recordagentcalls option in chan_agent to store the recorded file name in the bridge CDR.
  
  (closes issue #14590)
  Reported by: msetim
  Patches:
        queue_agent_userfield.patch uploaded by Laureano (license 265)
  Tested by: Laureano, mnicholson
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230628 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-20 21:01:10 +00:00
dvossel 56608fa6db audiohook signal trigger on every status change
(issue #14618)

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230583 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-20 17:26:20 +00:00
tilghman 317ea2e45d Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230111 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 20:42:03 +00:00
oej 71cb469beb Fixing trunk in a way so that it compiles again.
Thanks, Philippe :-)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229871 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 10:53:14 +00:00
oej 47269d650e Add the capability to require a module to be loaded, or else Asterisk exits.
Review: https://reviewboard.asterisk.org/r/426/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229819 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 08:52:28 +00:00
dbrooks 335ea57ff3 Merged revisions 229498 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r229498 | dbrooks | 2009-11-11 13:46:19 -0600 (Wed, 11 Nov 2009) | 8 lines
  
  Solaris doesn't like NULL going to ast_log
  
  Solaris will crash if NULL is passed to ast_log. This simple patch simply uses S_OR to
  get around this.
  
  (closes issue #15392)
  Reported by: yrashk
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229499 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-11 19:48:18 +00:00
tilghman 03da2826c7 Merged revisions 229360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r229360 | tilghman | 2009-11-10 16:09:16 -0600 (Tue, 10 Nov 2009) | 12 lines
  
  If two pattern classes start with the same digit and have the same number of characters, they will compare equal.
  The example given in the issue report is that of [234] and [246], which have
  these characteristics, yet they are clearly not equivalent.  The code still
  uses these two characteristics, yet when the two scores compare equal, an
  additional check will be done to compare all characters within the class to
  verify equality.
  (closes issue #15421)
   Reported by: jsmith
   Patches: 
         20091109__issue15421__2.diff.txt uploaded by tilghman (license 14)
   Tested by: jsmith, thedavidfactor
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229361 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-10 22:14:22 +00:00
lmadsen 01492b431e Merged revisions 228896 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228896 | lmadsen | 2009-11-09 09:37:43 -0600 (Mon, 09 Nov 2009) | 6 lines
  
  Update WARNING message.
  Update a WARNING message to give a suggested fix when encountered.
  
  (closes issue #16198)
  Reported by: atis
  Tested by: atis
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228897 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-09 15:38:38 +00:00
tilghman 4424b26d1e Fix various problems detected with Valgrind.
* chan_console accessed pvts after deallocation.
 * cdr_mysql stored a pointer that was freed by realloc()
 * The module loader did not check usecount on shutdown, which led to chan_iax2
 reading a timer that was already unloaded.
 * The event subsystem sometimes creates an event with no IEs.  Due to a corner
 condition, the code would read beyond the memory boundary.
 * res_pktccops did not correctly check whether its monitor thread was started.
(closes issue #16062)
 Reported by: alexanderheinz
 Patches: 
       20091109__issue16062.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228798 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-09 07:37:52 +00:00
dvossel 1d9ab2acea Merged revisions 228692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228692 | dvossel | 2009-11-06 16:33:27 -0600 (Fri, 06 Nov 2009) | 9 lines
  
  fixes audiohook write crash occuring in chan_spy whisper mode.
  
  After writing to the audiohook list in ast_write(), frames
  were being freed incorrectly.  Under certain conditions this
  resulted in a double free crash.
  
  (closes issue #16133)
  Reported by: wetwired

  (closes issue #16045)
  Reported by: bluecrow76
  Patches:
        issue16045.diff uploaded by dvossel (license 671)
  Tested by: bluecrow76, dvossel, habile
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228693 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06 22:35:44 +00:00
rmudgett f3e0c4020f Fix compiler warning gcc 4.2.4 found
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228621 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06 19:53:08 +00:00
mnicholson c5f892ebec Merged revisions 228378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228378 | mnicholson | 2009-11-06 10:26:59 -0600 (Fri, 06 Nov 2009) | 8 lines
  
  Properly handle '=' while decoding base64 messages and null terminate strings returned from BASE64_DECODE.
  
  (closes issue #15271)
  Reported by: chappell
  Patches:
        base64_fix.patch uploaded by chappell (license 8)
  Tested by: kobaz
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228620 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06 19:47:11 +00:00
file 4286b8c9d8 Merged revisions 228409 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228409 | file | 2009-11-06 12:41:20 -0400 (Fri, 06 Nov 2009) | 7 lines
  
  Fix a bug caused by a partially invalid frame (from the jitterbuffer) passing through the Asterisk core.
  
  (closes issue #15560)
  Reported by: jvandal
  (closes issue #15709)
  Reported by: covici
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228410 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06 16:42:23 +00:00
dvossel b952f6794d Merged revisions 228338 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228338 | dvossel | 2009-11-06 09:41:41 -0600 (Fri, 06 Nov 2009) | 5 lines
  
  fixes crash in astfd.c
  
  (closes issue #15981)
  Reported by: slavon
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228339 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-06 15:42:46 +00:00
tilghman f22eb8df19 Rework codecs command to comply with the 64-bit scheme
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228049 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-05 17:26:55 +00:00
mmichelson aac473afa7 Add a couple more casts so that code compiles correctly.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227646 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 16:41:02 +00:00
tilghman 3bacd4082e Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 14:05:12 +00:00
oej 193dd912da Add destruction of iterators to avoid problems with refcounters
(per Russell's review of another patch)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227545 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 08:22:00 +00:00
russell d8c79fc61c Resolve a warning from gcc 4.4.1.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227463 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 22:08:46 +00:00
dbrooks 741c3d606f AMI hook interface
This patch, originally submitted by jozza, enables custom modules to send actions to AMI
and receive messages from AMI via a hook interface. Included is a simple test module to
illustrate the interface.

(closes issue #14635)
Reported by: jozza

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227448 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 21:26:28 +00:00
mnicholson 899c3fed76 This patch adds a sequence field to CDRs that can be combined with the linkedid or uniqueid field to uniquely identify a CDR.
(closes issue #15180)
Reported by: Nick_Lewis
Patches:
      cdr-sequence10.diff uploaded by mnicholson (license 96)
Tested by: mnicholson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227435 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 21:21:09 +00:00
qwell 51cf1efae7 Fix some build issues on Solaris.
(closes issue #14517)
(SWP-109)
Reported by: asgaroth
Patches:
      bug_14517.diff uploaded by snuffy (license 35)
Tested by: asgaroth, snuffy, dougm, qwell


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227372 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 19:59:46 +00:00
oej edf8754788 Adding external reference for doxygen
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226970 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-02 20:43:52 +00:00
russell a0a2975952 Add an "Asterisk Architecture Overview" section to the doxygen documentation.
This is a side project I've been poking at this week.  The intent is to discuss
Asterisk architecture in a top down fashion to help new developers understand how
Asterisk is put together.  There is a ton of stuff to write about, so this will
just continue to evolve over time.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226606 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-30 04:08:39 +00:00
tilghman 7713586b10 Merged revisions 226138 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r226138 | tilghman | 2009-10-27 15:16:49 -0500 (Tue, 27 Oct 2009) | 7 lines
  
  Manager output is not always NULL-terminated, so force a NULL at the end of the filestream.
  (closes issue #15495)
   Reported by: pdf
   Patches: 
         20090916__issue15495.diff.txt uploaded by tilghman (license 14)
   Tested by: pdf
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226159 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-27 20:22:07 +00:00
kpfleming ef0206e9f1 Correct broken logic from revision 225405.
The code committed in revision 225405 was broken; instead of removing the unreference code,
the logic used to decide when to do it should have been reversed. This patch corrects the
situation, and makes reference counting work properly again.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225955 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-26 22:03:29 +00:00
dvossel 226347511b SIP TCP/TLS: move client connection setup/write into tcp helper thread, various related locking/memory fixes.
What this patch fixes
1.Moves sip TCP/TLS connection setup into the TCP helper thread:
  Connection setup takes awhile and before this it was being
  done while holding the monitor lock.
2.Moves TCP/TLS writing to the TCP helper thread:  Through the
  use of a packet queue and an alert pipe, the TCP helper thread
  can now be woken up to write data as well as read data.
3.Locking error: sip_xmit returned an XMIT_ERROR without giving
  up the tcptls_session lock.  This lock has been completely removed
  from sip_xmit and placed in the new sip_tcptls_write() function.
4.Memory leak:  When creating a tcptls_client the tls_cfg was alloced
  but never freed unless the tcptls_session failed to start.  Now the
  session_args for a sip client are an ao2 object which frees the
  tls_cfg on destruction.
5.Pointer to stack variable: During sip_prepare_socket the creation
  of a client's ast_tcptls_session_args was done on the stack and
  stored as a pointer in the newly created tcptls_session.  Depending
  on the events that followed, there was a slight possibility that
  pointer could have been accessed after the stack returned.  Given
  the new changes, it is always accessed after the stack returns
  which is why I found it.

Notable code changes
1.I broke tcptls.c's ast_tcptls_client_start() function into two
  functions.  One for creating and allocating the new tcptls_session,
  and a separate one for starting and handling the new connection.
  This allowed me to create the tcptls_session, launch the helper
  thread, and then establish the connection within the helper thread.
2.Writes to a tcptls_session are now done within the helper thread.
  This is done by using an alert pipe to wake up the thread if new
  data needs to be sent.  The thread's sip_threadinfo object contains
  the alert pipe as well as the packet queue.
3.Since the threadinfo object contains the alert pipe, it must now be
  accessed outside of the helper thread for every write (queuing of a
  packet).  For easy lookup, I moved the threadinfo objects from a
  linked list to an ao2_container.

(closes issue #13136)
Reported by: pabelanger
Tested by: dvossel, whys

(closes issue #15894)
Reported by: dvossel
Tested by: dvossel

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225445 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 19:55:51 +00:00
kpfleming 81747b8a32 Fix a refcount error introduced by yesterday's OBJ_MULTIPLE commit.
When an object is being unlinked from its container *and* being returned to
the caller, we do not want to decrement the reference count after unlinking
it from the container, as the reference that the container held is what we
are returning to the caller... and if it was the only remaining reference to
the object, that could result in the object being destroyed.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225405 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 18:41:47 +00:00
tilghman 3c27a56e3e Merged revisions 225105 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225105 | tilghman | 2009-10-21 11:02:12 -0500 (Wed, 21 Oct 2009) | 4 lines
  
  Fix documentation for ast_softhangup() and correct the misuse thereof.
  (closes issue #16103)
   Reported by: majorbloodnok
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225360 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 17:11:23 +00:00
rmudgett d7a3a1035d Add support for calling and called subaddress. Partial support for COLP subaddress.
The Telecom Specs in NZ suggests that SUB ADDRESS is always on, so doing
"desk to desk" between offices each with an asterisk box over the ISDN
should then be possible, without a whole load of DDI numbers required.

(closes issue #15604)
Reported by: alecdavis
Patches:
      asterisk_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585)
      Some minor modificatons were made.
Tested by: alecdavis, rmudgett

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225357 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 16:33:22 +00:00
kpfleming 4f428997ca Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

During this work, I removed the 'ao2_flags' arguments to the
ast_channel_iterator constructor functions; there were no uses of that
argument yet, there is only one possible flag to pass, and it made the
iterators less 'opaque'. If at some point in the future someone really
needs an ast_channel_iterator that does not lock the container, we can
provide constructor(s) for that purpose.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225244 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 21:08:47 +00:00
russell 02992ab888 Merged revisions 225171 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225171 | russell | 2009-10-21 11:44:49 -0500 (Wed, 21 Oct 2009) | 2 lines
  
  Revert 225169, as this doesn't account for the possibility of a list of frames.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225172 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 16:46:22 +00:00
russell 9a8be3b582 Merged revisions 225169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225169 | russell | 2009-10-21 11:39:20 -0500 (Wed, 21 Oct 2009) | 2 lines
  
  Isolate the frame returned from ast_translate().
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225170 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 16:42:13 +00:00
russell 039146041a Merged revisions 224931 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224931 | russell | 2009-10-20 21:59:54 -0500 (Tue, 20 Oct 2009) | 5 lines
  
  Isolate frames returned from a DSP instance or codec translator.
  
  The reasoning for these changes are the same as what I wrote in the commit
  message for rev 222878.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224932 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 03:09:04 +00:00
tilghman 38f43cba1b Merged revisions 224855 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224855 | tilghman | 2009-10-20 17:07:11 -0500 (Tue, 20 Oct 2009) | 5 lines
  
  Pay attention to the return value of the manipulate function.
  While this looks like an optimization, it prevents a crash from occurring
  when used with certain audiohook callbacks (diagnosed with SVN trunk,
  backported to 1.4 to keep the source consistent across versions).
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224856 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-20 22:09:07 +00:00
file f7822860b4 Merged revisions 224773 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224773 | file | 2009-10-20 14:46:37 -0300 (Tue, 20 Oct 2009) | 5 lines
  
  Add support for relaying early media in the features attended transfer option.
  
  (closes issue #14828)
  Reported by: licedey
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224774 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-20 17:47:34 +00:00
tilghman 0ff900410d Remove unnecessary typedef
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224403 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-17 16:39:37 +00:00
tilghman 0c997b3fd1 Create an API for adding an optional time unit onto the ends of time periods.
Two examples of its use are included, and the usage could be expanded in some
cases into certain configuration options where time periods are specified.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224225 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-15 22:33:30 +00:00
russell 0fa9b24b8b Merged revisions 223485-223486 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223485 | russell | 2009-10-11 12:22:52 -0500 (Sun, 11 Oct 2009) | 6 lines
  
  Don't use data outside of its scope.
  
  The purpose of this code was to have a hangup frame put on the list of deferred
  frames.  However, the code that read the hangup frame was outside of the scope
  of where the hangup frame was declared.
........
  r223486 | russell | 2009-10-11 12:25:06 -0500 (Sun, 11 Oct 2009) | 2 lines
  
  Remove some unnecessary code.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223487 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-11 17:25:42 +00:00
mnicholson c332afdfa1 Merged revisions 223225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223225 | mnicholson | 2009-10-09 13:20:11 -0500 (Fri, 09 Oct 2009) | 8 lines
  
  Signal timeouts by returning AST_CONTROL_RINGING when originating calls.
  (closes issue #15104)
  Reported by: nblasgen
  Patches:
        manager-timeout1.diff uploaded by mnicholson (license 96)
  Tested by: nblasgen, mnicholson
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223273 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09 18:34:08 +00:00
russell 5b989dda45 Merged revisions 222878 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222878 | russell | 2009-10-08 14:45:47 -0500 (Thu, 08 Oct 2009) | 44 lines
  
  Make filestream frame handling safer by isolating frames before returning them.
  
  This patch is related to a number of issues on the bug tracker that show
  crashes related to freeing frames that came from a filestream.  A number of
  fixes have been made over time while trying to figure out these problems, but
  there re still people seeing the crash.  (Note that some of these bug reports
  include information about other problems.  I am specifically addressing
  the filestream frame crash here.)
  
  I'm still not clear on what the exact problem is.  However, what is _very_
  clear is that we have seen quite a few problems over time related to unexpected
  behavior when we try to use embedded frames as an optimization.  In some cases,
  this optimization doesn't really provide much due to improvements made in other
  areas.
  
  In this case, the patch modifies filestream handling such that the embedded frame
  will not be returned.  ast_frisolate() is used to ensure that we end up with a
  completely mallocd frame.  In reality, though, we will not actually have to malloc
  every time.  For filestreams, the frame will almost always be allocated and freed
  in the same thread.  That means that the thread local frame cache will be used.
  So, going this route doesn't hurt.
  
  With this patch in place, some people have reported success in not seeing the
  crash anymore.
  
  (SWP-150)
  (AST-208)
  (ABE-1834)
  
  (issue #15609)
  Reported by: aragon
  Patches:
        filestream_frisolate-1.4.diff2.txt uploaded by russell (license 2)
  Tested by: aragon, russell
  
  (closes issue #15817)
  Reported by: zerohalo
  Tested by: zerohalo
  
  (closes issue #15845)
  Reported by: marhbere
  
  Review: https://reviewboard.asterisk.org/r/386/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222880 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 19:52:03 +00:00
dvossel 21cc1ec955 fixes an ast_netsock_list memory leak.
ABE-1998
Review: https://reviewboard.asterisk.org/r/395/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222873 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 19:35:30 +00:00
dvossel 41a7e60c45 Deadlock in channel masquerade handling
Channels are stored in an ao2_container.  When accessing an item within
an ao2_container the proper locking order is to first lock the container,
and then the items within it.

In ast_do_masquerade both the clone and original channel must be locked
for the entire duration of the function.  The problem with this is that
it attemptes to unlink and link these channels back into the ao2_container
when one of the channel's name changes.  This is invalid locking order as
the process of unlinking and linking will lock the ao2_container while
the channels are locked!!! Now, both the channels in do_masquerade are
unlinked from the ao2_container and then locked for the entire function.
At the end of the function both channels are unlocked and linked back
into the container with their new names as hash values.

This new method of requiring all channels and tech pvts to be unlocked
before ast_do_masquerade() or ast_change_name() required several
changes throughout the code base.

(closes issue #15911)
Reported by: russell
Patches:
      masq_deadlock_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, atis

(closes issue #15618)
Reported by: lmsteffan
Patches:
      deadlock_local_attended_transfers_trunk.diff uploaded by dvossel (license 671)
Tested by: lmsteffan, dvossel

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222761 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07 22:58:38 +00:00
kpfleming e299cf0653 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222176 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 01:24:24 +00:00
kpfleming f5671885b8 Allow non-compliant T.38 endpoints to be supportable via configuration option.
Many T.38 endpoints incorrectly send the maximum IFP frame size they can accept
as the T38FaxMaxDatagram value in their SDP, when in fact this value is
supposed to be the maximum UDPTL payload size (datagram size) they can accept.
If the value they supply is small enough (a commonly supplied value is '72'),
T.38 UDPTL transmissions will likely fail completely because the UDPTL packets
will not have enough room for a primary IFP frame and the redundancy used for
error correction. If this occurs, the Asterisk UDPTL stack will emit log messages
warning that data loss may occur, and that the value may need to be overridden.

This patch extends the 't38pt_udptl' configuration option in sip.conf to allow
the administrator to override the value supplied by the remote endpoint and
supply a value that allows T.38 FAX transmissions to be successful with that
endpoint. In addition, in any SIP call where the override takes effect, a debug
message will be printed to that effect. This patch also removes the
T38FaxMaxDatagram configuration option from udptl.conf.sample, since it has not
actually had any effect for a number of releases.

In addition, this patch cleans up the T.38 documentation in sip.conf.sample
(which incorrectly documented that T.38 support was passthrough only).

(issue #15586)
Reported by: globalnetinc


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222110 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-05 19:45:00 +00:00
tilghman 4ecd294510 Merged revisions 221970 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221970 | tilghman | 2009-10-02 11:58:03 -0500 (Fri, 02 Oct 2009) | 2 lines
  
  Ensure the result of the hash function is positive.  Negative array offsets suck.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221971 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-02 16:59:57 +00:00
tilghman 6ceb1b581c Initialize a variable that we check immediately upon startup.
(closes issue #15973)
 Reported by: atis


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221920 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-02 03:04:34 +00:00
tilghman 486821d077 One more off-by-one in trunk
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221781 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-02 00:08:21 +00:00
tilghman 5081871fa4 Merged revisions 221776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221776 | tilghman | 2009-10-01 18:53:12 -0500 (Thu, 01 Oct 2009) | 2 lines
  
  Fix a bunch of off-by-one errors
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221777 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 23:59:15 +00:00
kpfleming f665ff4af1 Remove ability to control T.38 FAX error correction from udptl.conf.
chan_sip has had the ability to control T.38 FAX error correction mode on a per-peer
(or global) basis for a couple of releases now, which is where it should have been
all along. This patch removes the ability to configure it in udptl.conf, but issues
a warning if the user tries to do, telling them to look at sip.conf.sample for how
to configure it now. For any SIP peers that are T.38 enabled in sip.conf, there is
already a default for FEC error correction even if the user does not specify any mode,
so this change will not turn off error correction by default, it will have the same
default value that has been in the udptl.conf sample file.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221592 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 16:16:09 +00:00
twilson b8e1d3fe36 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221278 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 18:21:03 +00:00
twilson bc354c76f4 Merged revisions 221086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221086 | twilson | 2009-09-30 09:49:11 -0500 (Wed, 30 Sep 2009) | 25 lines
  
  Change the SSRC by default when our media stream changes
  
  Be default, change SSRC when doing an audio stream changes Asterisk doesn't
  honor marker bit when reinvited to already-bridged RTP streams,resulting in
  far-end stack discarding packets with "old" timestamps that areactually part of
  a new stream.  This patch sends AST_CONTROL_SRCUPDATE whenever there is a
  reinvite, unless the 'constantssrc' is set to true in sip.conf.
  
  The original issue reported to Digium support detailed the following situation:
  ITSP <-> Asterisk 1.4.26.2 <-> SIP-based Application Server Call comes in
  fromITSP, Asterisk dials the app server which sends a re-invite back
  toAsterisk--not to negotiate to send media directly to the ITSP, but to
  indicatethat it's changing the stream it's sending to Asterisk.  The app
  servergenerates a new SSRC, sequence numbers, timestamps, and sets the marker
  bit on the new stream.  Asterisk passes through the teimstamp of the new stream,
  butdoes not reset the SSRC, sequence numbers, or set the marker bit.
  
  When the timestamp on the new stream is older than the timestamp on the
  originalstream, the ITSP (which doesn't know there has been any change) discards
  the newframes because it thinks they are too old.  This patch addresses this by
  changing the SSRC on a stream update unless constantssrc=true is set in
  sip.conf.
  
  Review: https://reviewboard.asterisk.org/r/374/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221266 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 17:52:30 +00:00
tilghman a1c22c9512 Merged revisions 221200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221200 | tilghman | 2009-09-30 11:55:21 -0500 (Wed, 30 Sep 2009) | 7 lines
  
  Avoid a potential NULL dereference.
  (closes issue #15865)
   Reported by: kobaz
   Patches: 
         20090915__issue15865.diff.txt uploaded by tilghman (license 14)
   Tested by: kobaz
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221201 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 16:56:42 +00:00
mmichelson ab67ce4214 Fix channel reference leak.
ast_cel_report_event would geet a reference to the
bridged channel. However, certain return paths, such
as if CEL was not enabled, would result in a reference
leak. All return paths now properly unref the channel.

(closes issue #15991)
Reported by: mmichelson



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220995 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-29 21:28:04 +00:00
mmichelson 20a1feb888 Get rid of annoying and cryptic debug messages.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220920 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-29 20:20:48 +00:00
kpfleming c359691aa3 Eliminate unnecessary include of version.h in manager.c.
Including version.h here causes this file to get recompiled after
every commit or update, which is not needed.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220496 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25 14:50:29 +00:00
kpfleming f700382e8b Correct sense of logic test committed in revision 220494.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220495 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25 14:44:40 +00:00
kpfleming 4a49a4a98b Don't use hash-based lookups for ast_channel_get_by_name_prefix().
ast_channel_get_full() tries to use OBJ_POINTER to optimize name-based
channel lookups, but this will not work properly when the channel's full
name was not supplied; for name-prefix searches, there is no value in
doing a hash-based lookup, and in fact doing so could result in many
channels being skipped.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220494 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25 14:38:41 +00:00
tilghman d170b913b9 Change the default behavior of Set, AGI, and pbx_realtime to 1.6 behavior by default (starting in 1.6.3).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220417 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 22:53:23 +00:00
dvossel 3f2a26dd7b fixes tcptls_session memory leak caused by ref count error
(closes issue #15939)
Reported by: dvossel

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220365 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 20:37:20 +00:00
jpeeler 4e9238c881 Add bridge related dial flags to the bridge app
Most of the functionality here is gained simply by setting the feature flag
on the bridge config. However, the dial limit functionality has been moved from
app_dial to the features code and has been made public so both app_dial and
the bridge app can use it.

(closes issue #13165)
Reported by: tim_ringenbach
Patches:
      app_bridge_options_r138998.diff uploaded by tim ringenbach (license 540),
      modified by me


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220344 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 20:29:51 +00:00
tilghman a0a179b39a Merged revisions 220288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r220288 | tilghman | 2009-09-24 14:39:41 -0500 (Thu, 24 Sep 2009) | 6 lines
  
  Implicitly sending a progress signal breaks some applications.
  Call Progress() in your dialplan if you explicitly want progress to be sent.
  (Reverts change 216430, closes issue #15957)
  Reported by: Pavel Troller on the Asterisk-Dev mailing list
  http://lists.digium.com/pipermail/asterisk-dev/2009-September/039897.html
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220289 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 19:41:02 +00:00
tilghman aa7f40e22b Merged revisions 219653 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219653 | tilghman | 2009-09-20 12:52:05 -0500 (Sun, 20 Sep 2009) | 8 lines
  
  Really stop the stream, when ast_closestream() is called.
  (closes issue #15129)
   Reported by: bmh
   Patches: 
         20090918__issue15129.diff.txt uploaded by tilghman (license 14)
   Review:
         https://reviewboard.asterisk.org/r/372/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219654 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-20 17:55:49 +00:00
mnicholson 667d2ffb9d Merged revisions 219136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219136 | mnicholson | 2009-09-17 09:58:39 -0500 (Thu, 17 Sep 2009) | 10 lines
  
  Prevent a potential race condition and crash when hanging up a channel by removing the channel from the channel list before begining channel tear down.
  
  This fix may potentially cause problems with CDR backends that access the channel a CDR is associated with via the channel list.  This fix makes the channel unavabile at the time when the CDR backend is invoked.  This has been documented in include/asterisk/cdr.h.
  
  (closes issue #15316)
  Reported by: vmarrone
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/362/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219139 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17 15:18:01 +00:00
tilghman 5026ab41bd Merged revisions 219023 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219023 | tilghman | 2009-09-16 18:21:53 -0500 (Wed, 16 Sep 2009) | 8 lines
  
  Properly deal with quotes in the arguments of '#exec' includes.
  (closes issue #15583)
   Reported by: pkempgen
   Patches: 
         20090726__issue15583.diff.txt uploaded by tilghman (license 14)
         20090726__issue15583-1.4-4.diff.txt uploaded by pkempgen (license 169)
   Tested by: pkempgen
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219061 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-16 23:42:12 +00:00
dbrooks 5bc9c2a0b5 Merged revisions 218867 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r218867 | dbrooks | 2009-09-16 13:00:45 -0500 (Wed, 16 Sep 2009) | 13 lines
  
  Fixes CID pattern matching behavior to mirror that of extension pattern matching.
  
  Pattern matching for extensions uses a type of scoring system, giving values for
  specificity to each character in the pattern. Unfortunately, this is done character
  by character, in order. This does lead to some less specific patterns being first
  in line for matching, but it will usually get the job done.
  
  This patch merely brings CID matching to the same level as extension matching.
  This patch does not attempt to tackle the problem shared by extension matching.
  
  (closes issue #14708)
  Reported by: klaus3000
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218868 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-16 18:06:42 +00:00
file 046ca84efa Do not attempt to add a parking extension if an error occurred while reading the configuration.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218295 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-14 18:16:39 +00:00
tilghman ac1806650d Check the origination priority for more matches, not the current priority.
Found by Pavel Troller on the -dev list.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218050 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-11 05:58:11 +00:00
seanbright 29bf63b15a Properly terminate the response to the manager Ping action.
In passing, correct the formatting of the Timestamp attribute so that there is a
space after the colon and before the value.

(closes issue #15861)
Reported by: Ivan


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217408 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-09 12:11:12 +00:00
tilghman 5b68ca1a7e Enable turning off the application delimiter warning with the 'dontwarn' option.
Suggested on the -dev list, and implemented in an alternate way by me.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216547 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 17:31:44 +00:00
mvanbaak 7acc8bcaf3 Merged revisions 216435 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r216435 | mvanbaak | 2009-09-04 15:56:10 +0200 (Fri, 04 Sep 2009) | 2 lines
  
  make asterisk compile under devmode with DEBUG_THREADS enabled on OpenBSD
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216506 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 15:05:05 +00:00
oej 6a9ca399c1 Merged revisions 216430 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r216430 | oej | 2009-09-04 15:45:48 +0200 (Fre, 04 Sep 2009) | 27 lines

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: http://svn.digium.com/svn/asterisk/trunk@216438 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 14:02:34 +00:00
mvanbaak 3330d65ba1 make sure 'start' is always initialized.
Makes asterisk compile with --enable-dev-mode


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216222 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 06:08:33 +00:00
kpfleming bf3bf7eb25 Document language prompt submission process.
This patch adds a document describing the language prompt submission process,
licensing terms and other issues related to that process. In addition, it
modifies the sound file searching process to support language codes with
any number of suffices (not limited to just "xx" or "xx_YY"), so that prompts
can be named with gender, customer/company, etc. suffices as well.

(closes issue #15771)
Reported by: jtodd
Patches:
      language-criteria.txt uploaded by jtodd



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216006 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 18:42:38 +00:00
dvossel 39acf19959 Merge code associated with AST-2009-006
(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215955 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 16:31:54 +00:00
mvanbaak a458cefb1d - lock channel before looking for a channel variable
- Init the parkings list member of struct parkinglot.
Thanks Sean for the explanation why this should be here.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215622 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 20:21:51 +00:00
tilghman d263efd302 Close up to the soft open file limit (same on Linux, but varies drastically on OS X).
Also, a Makefile fix for Darwin (OS X).
(closes issue #14542)
 Reported by: jtodd
 Patches: 
       20090901__issue14542.diff.txt uploaded by tilghman (license 14)
 Tested by: jtodd, tilghman
 Change-type: bugfix


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215567 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 18:37:25 +00:00
kpfleming cd4f1047ec Ensure that frame dumps of AST_CONTROL_T38_PARAMETERS frames are properly
decoded.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215161 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-01 19:50:48 +00:00
tilghman 8c2e950cb4 Fix a trunk compilation warning.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215070 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-31 22:02:24 +00:00
tilghman cad24a7000 Properly initialize the session to prevent a crash.
(closes issue #15774)
 Reported by: lasko
 Patches: 
       20090831__issue15774.diff.txt uploaded by tilghman (license 14)
 Tested by: lasko


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215069 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-31 21:45:00 +00:00
tilghman 336a05fe3a Various patches, to enable Asterisk to once again compile on Mac OS X.
One note on defining _POSIX_C_SOURCE:  while this feature test macro
works to require certain behaviors on Linux, it works differently on *BSD
platforms to REMOVE certain API calls that are not in the POSIX specification,
such as vasprintf(3).  Thus, defining it while depending upon vasprintf (and
other extensions to the POSIX standard) to be defined is a recipe to ensure
that Asterisk is only buildable on Linux.

Hence, this define which was meant to INCREASE portability, effectively
ensures the opposite.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214863 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-30 18:37:17 +00:00
tilghman 1bc661ff56 Merged revisions 214701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214701 | tilghman | 2009-08-28 15:13:32 -0500 (Fri, 28 Aug 2009) | 8 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@214702 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-28 20:14:39 +00:00
tilghman f6cd641eef Ensure that we check for the special value CONFIG_STATUS_FILEINVALID.
(closes issue #15786)
 Reported by: a_villacis
 Patches: 
       asterisk-1.6.2.0-beta4-manager-fix-crash-on-include-nonexistent-file.patch uploaded by a villacis (license 660)
       (Plus a few of my own, to catch the remaining places within manager.c where it could have been a problem)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214514 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-27 21:26:37 +00:00
jpeeler 973d813ca1 Add two new dialplan variables when using features
Added DYNAMIC_FEATURENAME which holds the last triggered dynamic feature.
Added DYNAMIC_PEERNAME which holds the unique channel name on the other side
and is set when a dynamic feature is triggered.

(closes issue #14663)
Reported by: tamiel
Patches:
      20090313_features.diff uploaded by tamiel (license 712)
Tested by: tamiel


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214309 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-26 23:13:19 +00:00
dvossel 2a2e250033 Merged revisions 214194 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214194 | dvossel | 2009-08-26 11:36:42 -0500 (Wed, 26 Aug 2009) | 19 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@214195 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-26 16:38:53 +00:00
tilghman c123693a36 Merged revisions 214068-214069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214068 | tilghman | 2009-08-25 14:26:50 -0500 (Tue, 25 Aug 2009) | 6 lines
  
  Fix pronunciation of German dates.
  (closes issue #15273)
   Reported by: Benjamin Kluck
   Patches: 
         say_c.patch uploaded by Benjamin Kluck (license 803)
........
  r214069 | tilghman | 2009-08-25 14:28:42 -0500 (Tue, 25 Aug 2009) | 2 lines
  
  I should always compile before committing...
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214071 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-25 19:32:48 +00:00
tilghman bc76aecadd Merged revisions 213970 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r213970 | tilghman | 2009-08-25 01:34:44 -0500 (Tue, 25 Aug 2009) | 7 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@213971 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-25 06:35:37 +00:00
twilson eb70a920b5 Make LOAD_ORDER actually work
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@213450 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-21 03:48:54 +00:00
mnicholson 824d119548 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: http://svn.digium.com/svn/asterisk/trunk@213327 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-20 20:29:32 +00:00
qwell 636faf006e Fix compile when certain G711 menuselect options are enabled.
(closes issue #15697)
Reported by: slavon


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@213179 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-19 22:38:46 +00:00
russell a176e15b0f Don't blow up on a NULL cdr.
Reported in #asterisk-dev.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@213046 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-19 15:32:18 +00:00
seanbright 47c42e6fb6 Merged revisions 212763 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r212763 | seanbright | 2009-08-18 12:36:00 -0400 (Tue, 18 Aug 2009) | 11 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@212764 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-18 16:38:36 +00:00
seanbright 864cae562c Correct the return value check for ast_safe_system.
The logic here was reversed as ast_safe_system returns -1 on error and not on
success.  Fix suggested by reporter.

(closes issue #15667)
Reported by: loic


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212574 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17 18:18:16 +00:00
kpfleming d32b7ae7b1 Define our desires for POSIX and X/OPEN API features properly.
Based on a post on the gcc-help mailing list and some subsequent reading,
we can increase our portability to various platforms by directly defining
the POSIX and X/OPEN API feature sets we wish to have available. This patch
does that, and also includes a double-check to ensure that the system
we are compiling on can actually provide the requested feature sets.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212463 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17 16:25:10 +00:00
file 5a6957c04a Add two more API calls for getting the current glue and channel in bridging code.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212390 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-16 19:27:39 +00:00
mvanbaak 499661cac0 Add an empty line after each option when printing the
documentation of a function/application.

This will make reading the docs on the CLI way more easy.

(closes issue #15694)
Reported by: mvanbaak
Patches:
      2009081100-extralinesoptionlist.diff.txt uploaded by mvanbaak (license 7)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212339 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-15 11:25:11 +00:00
file 3b081ef0ff Add an API call for retrieving the engine in use by an RTP instance.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212161 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-13 16:44:54 +00:00
tilghman d1ec1aa57d AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10 19:20:57 +00:00
russell 4b2e61e8ee Fix up some issues with getting a channel by "name".
Even though the get_channel_by_name() API advertised that you could search by
name or uniqueid (just as the old API did), searching by uniqueid was not
actually implemented.  This patch fixes that problem.

The ast_channel_get_full() function now makes a second search attempt by
uniqueid if the parameter was a name.  The channel comparison function also
now knows how to compare by unqieueid.

Finally, a bug was fixed in passing where OBJ_POINTER was being passed in some
scenarios where it should not have been.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211390 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10 15:46:39 +00:00
tilghman 8718941fe1 Merged revisions 211274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r211274 | tilghman | 2009-08-09 10:41:01 -0500 (Sun, 09 Aug 2009) | 2 lines
  
  Small oops.  Clear the flags which have been checked.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211275 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-09 15:42:02 +00:00
kpfleming b33fdfb5ea Workaround broken T.38 endpoints that offer tiny MaxDatagram sizes.
Some T.38 endpoints treat T38FaxMaxDatagram as the maximum IFP size that should
be sent to them, rather than the maximum packet payload size. If such an
endpoint also requests UDPRedundancy as the error correction mode, we'll end
up calculating a tiny maximum IFP size, so small as to be unusable. This patch
sets a lower bound on what we'll consider the remote's maximum IFP size to be,
assuming that endpoints that do this really can accept larger packets than
they've offered to accept.

(closes issue #15649)
Reported by: dazza76


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210992 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-07 13:08:00 +00:00
tilghman b03533a403 Merged revisions 210913 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r210913 | tilghman | 2009-08-06 16:45:01 -0500 (Thu, 06 Aug 2009) | 7 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@210914 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-06 21:46:01 +00:00
tilghman e32af8f0cf Allow Gosub to recognize quote delimiters without consuming them.
(closes issue #15557)
 Reported by: rain
 Patches: 
       20090723__issue15557.diff.txt uploaded by tilghman (license 14)
 Tested by: rain
 
Review: https://reviewboard.asterisk.org/r/316/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210908 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-06 21:29:26 +00:00
russell b2e008a372 Revert some silly code that snuck into trunk from my working copy. Sorry!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210522 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-05 14:09:24 +00:00
rmudgett 09b65c6596 Initial minimum ast_party_caller support.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210354 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-04 16:36:41 +00:00
jpeeler 090abe2554 Fix broken call pickup
The find_channel_by_group callback was only looking at the channel that was
attempting to make the pickup instead of the other channels in the container.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210302 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-04 15:35:49 +00:00
mmichelson d7fae26783 Fix order and redundancy of channel rename manager events in ast_do_masquerade.
Patch contributed by Mark Spencer.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-03 14:29:17 +00:00
russell f9d6e38035 Merged revisions 209879 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209879 | russell | 2009-08-01 06:27:25 -0500 (Sat, 01 Aug 2009) | 5 lines
  
  Resolve a valgrind warning about a read from uninitialized memory.
  
  (issue #15396)
  Reported by: aragon
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209887 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-01 11:29:25 +00:00
russell 07f51375e7 Fix ast_event_queue_and_cache() to actually do the cache() part.
(closes issue #15624)
Reported by: ffossard
Tested by: russell


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209835 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-01 10:43:40 +00:00
kpfleming 7c81679557 Merged revisions 209759 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209759 | kpfleming | 2009-07-31 19:52:00 -0500 (Fri, 31 Jul 2009) | 7 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@209760 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-01 01:03:07 +00:00
russell 80248fe952 Fix some places where ast_event_type was used instead of ast_event_ie_type.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209711 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-31 21:53:31 +00:00
kpfleming c268ce9100 Define side-effect-safe MIN and MAX macros and remove duplicate definitions from various files.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209400 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-28 13:49:46 +00:00
mmichelson fd394359e2 Merged revisions 209131 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r209131 | mmichelson | 2009-07-27 12:44:06 -0500 (Mon, 27 Jul 2009) | 18 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@209132 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 17:50:04 +00:00
dbrooks 3a578de20c Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209098 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 16:33:50 +00:00
jpeeler 68253f0e47 Merged revisions 208923 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208923 | jpeeler | 2009-07-26 20:18:31 -0500 (Sun, 26 Jul 2009) | 2 lines
  
  Fix logic errors from 208746
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208924 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 01:20:37 +00:00
mvanbaak 9d2db62b61 add default alias reload to run module reload.
Requiring 'module reload' to reload everything, including
core etc makes russell very unhappy.

The default configuration already loads the 'friendly' aliases template.
Added 'reload=module reload' to that template.

Also removed the comment in main/cli.c that reload should come back.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208813 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-25 12:03:25 +00:00
jpeeler 8b161d8e38 Merged revisions 208746 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208746 | jpeeler | 2009-07-25 01:19:50 -0500 (Sat, 25 Jul 2009) | 7 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@208749 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-25 06:23:18 +00:00
russell 661b443775 Note that "reload" needs to be added back.
I keep getting annoyed at having to type "module reload" to reload everything,
so I'm adding a note that we need to add "reload" back.  "module reload" doesn't
really make sense as the command to reload everything, including the core.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208706 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-24 20:54:37 +00:00
russell 28b480de5b Don't log a warning for something that does not affect operation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208693 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-24 20:25:23 +00:00
kpfleming b4baa21fbf Resolve a T.38 negotiation issue left over from the udptl-updates merge.
The udptl-updates branch that was merged yesterday failed to properly send back
T.38 SDP responses with the correct error correction mode, if the incoming SDP
from the other end caused us to change error correction modes. This patch
corrects that situation.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208548 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-24 15:02:53 +00:00
kpfleming aa4f4e142d Rework of T.38 negotiation and UDPTL API to address interoperability problems
Over the past couple of months, a number of issues with Asterisk
negotiating (and successfully completing) T.38 sessions with various
endpoints have been found. This patch attempts to address many of
them, primarily focused around ensuring that the endpoints'
MaxDatagram size is honored, and in addition by ensuring that T.38
session parameter negotiation is performed correctly according to the
ITU T.38 Recommendation.

The major changes here are:

1) T.38 applications in Asterisk (app_fax) only generate/receive IFP
packets, they do not ever work with UDPTL packets. As a result of
this, they cannot be allowed to generate packets that would overflow
the other endpoints' MaxDatagram size after the UDPTL stack adds any
error correction information. With this patch, the application is told
the maximum *IFP* size it can generate, based on a calculation using
the far end MaxDatagram size and the active error correction mode on
the T.38 session. The same is true for sending *our* MaxDatagram size
to the remote endpoint; it is computed from the value that the
application says it can accept (for a single IFP packet) combined with
the active error correction mode.

2) All treatment of T.38 session parameters as 'capabilities' in
chan_sip has been removed; these parameters are not at all like
audio/video stream capabilities. There are strict rules to follow for
computing an answer to a T.38 offer, and chan_sip now follows those
rules, using the desired parameters from the application (or channel)
that wants to accept the T.38 negotiation.

3) chan_sip now stores and forwards ast_control_t38_parameters
structures for tracking 'our' and 'their' T.38 session parameters;
this greatly simplifies negotiation, especially for pass-through
calls.

4) Since T.38 negotiation without specifying parameters or receiving
the final negotiated parameters is not very worthwhile, the
AST_CONTROL_T38 control frame has been removed. A note has been added
to UPGRADE.txt about this removal, since any out-of-tree applications
that use it will no longer function properly until they are upgraded
to use AST_CONTROL_T38_PARAMETERS.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208464 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23 21:57:24 +00:00
russell 0349eaca41 Resolve compiler warning on mac.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208193 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23 01:31:18 +00:00
tilghman 2546725dee Merged revisions 208083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208083 | tilghman | 2009-07-22 15:23:53 -0500 (Wed, 22 Jul 2009) | 4 lines
  
  Export symbols for functions included in our compatibility headers.
  (closes issue #15556)
   Reported by: smw1218
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208151 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-22 22:35:57 +00:00
mmichelson 5bc2ee7e25 Merged revisions 207714 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207714 | mmichelson | 2009-07-21 09:26:00 -0500 (Tue, 21 Jul 2009) | 5 lines
  
  Document default timeout for AMI originations.
  
  AST-224
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@207723 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21 14:29:40 +00:00
kpfleming 3dbaf0de9a Merged revisions 207647 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207647 | kpfleming | 2009-07-21 08:04:44 -0500 (Tue, 21 Jul 2009) | 12 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@207680 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21 13:28:04 +00:00
russell f6389a2711 Merged revisions 207360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207360 | russell | 2009-07-20 11:26:24 -0500 (Mon, 20 Jul 2009) | 9 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@207361 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-20 16:36:15 +00:00
dvossel 86cd5db2fe Merged revisions 206867 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r206867 | dvossel | 2009-07-16 16:24:16 -0500 (Thu, 16 Jul 2009) | 8 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@206868 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-16 21:25:22 +00:00
russell ef09b20743 Add an API for reporting security events, and a security event logging module.
This commit introduces the security events API.  This API is to be used by
Asterisk components to report events that have security implications.
A simple example is when a connection is made but fails authentication.  These
events can be used by external tools manipulate firewall rules or something
similar after detecting unusual activity based on security events.

Inside of Asterisk, the events go through the ast_event API.  This means that
they have a binary encoding, and it is easy to write code to subscribe to these
events and do something with them.

One module is provided that is a subscriber to these events - res_security_log.
This module turns security events into a parseable text format and sends them
to the "security" logger level.  Using logger.conf, these log entries may be
sent to a file, or to syslog.

One service, AMI, has been fully updated for reporting security events.
AMI was chosen as it was a fairly straight forward service to convert.
The next target will be chan_sip.  That will be more complicated and will
be done as its own project as the next phase of security events work.

For more information on the security events framework, see the documentation
generated from doc/tex/.  "make asterisk.pdf"

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@206021 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-11 19:15:03 +00:00
kpfleming 2f29179f53 Update comments about the level of T.38 support in Asterisk.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205939 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-10 18:44:09 +00:00
mvanbaak 9049f69743 make this compile again under devmode
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205562 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-09 14:10:01 +00:00
mvanbaak e8c95985ba 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.

Tested on OpenBSD and Linux both 32 and 64 bit


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205532 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-09 08:31:24 +00:00
mnicholson 7efd4c17d8 Fix a CEL related regression with hints updating by subscribing to AST_DEVICE_STATE instead of AST_DEVICE_STATE_CHANGED.
(closes issue #15440)
Reported by: lmsteffan


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205469 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 23:07:09 +00:00
dvossel 8d6e8908f4 Merged revisions 205409 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205409 | dvossel | 2009-07-08 16:35:12 -0500 (Wed, 08 Jul 2009) | 6 lines
  
  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: http://svn.digium.com/svn/asterisk/trunk@205412 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 22:15:06 +00:00
dvossel 7fcfa25faa missing comma in devstatestring array
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205410 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 22:02:54 +00:00
dbrooks 31d6a3d8d0 Fixes Park() argument handling
Park() was not respecting the arguments passed to it. Any extension/context/priority
given to it was being ignored. This patch remedies this.

(closes issue #15380)
Reported by: DLNoah


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205254 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 17:26:26 +00:00
tilghman a2a53fda84 Oops, fixing build
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205221 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 16:59:32 +00:00
seanbright 5b4529e89e Fix a few compilation problems found when building Asterisk against uClibc.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205214 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 16:43:12 +00:00
tilghman 7c0bbc9c8d Merged revisions 205188 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205188 | tilghman | 2009-07-08 11:26:15 -0500 (Wed, 08 Jul 2009) | 2 lines
  
  Add redirection warnings for the invalid language codes previously removed.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205196 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 16:27:50 +00:00
russell bd24ce971c Use tabs instead of spaces for indentation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205151 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 15:56:28 +00:00
russell aa0e8f1b3c Move OpenSSL initialization to a single place, make library usage thread-safe.
While doing some reading about OpenSSL, I noticed a couple of things that
needed to be improved with our usage of OpenSSL.

1) We had initialization of the library done in multiple modules.  This has now
   been moved to a core function that gets executed during Asterisk startup.
   We already link OpenSSL into the core for TCP/TLS functionality, so this
   was the most logical place to do it.

2) 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: http://svn.digium.com/svn/asterisk/trunk@205120 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 15:17:19 +00:00
kpfleming db49d9fa23 Improve handling of AST_CONTROL_T38 and AST_CONTROL_T38_PARAMETERS for non-T.38-capable channels.
This change allows applications that request T.38 negotiation on a channel that
does not support it to get the proper indication that it is not supported, rather
than thinking that negotiation was started when it was not.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204948 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-06 13:38:29 +00:00