Commit Graph

282 Commits

Author SHA1 Message Date
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
David Vossel 7f23115ad2 New HD ConfBridge conferencing application.
Includes a new highly optimized and customizable
ConfBridge application capable of mixing audio at
sample rates ranging from 8khz-192khz.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 18:11:40 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 16:55:39 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Jason Parker 20fefec7a3 Merged revisions 305473 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r305473 | qwell | 2011-02-01 11:04:23 -0600 (Tue, 01 Feb 2011) | 23 lines
  
  Merged revisions 305472 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r305472 | qwell | 2011-02-01 11:02:09 -0600 (Tue, 01 Feb 2011) | 16 lines
    
    Merged revisions 305471 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r305471 | qwell | 2011-02-01 11:00:55 -0600 (Tue, 01 Feb 2011) | 9 lines
      
      Close file descriptor for timing source when a MOH class gets destroyed.
      
      (closes issue #18457)
      Reported by: mcallist
      Patches: 
            18457-closetimer.diff uploaded by qwell (license 4)
            18457-closetimer_trunk.diff uploaded by qwell (license 4)
      Tested by: qwell, loloski
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-01 17:05:38 +00:00
Jason Parker 0bed3e751a Merged revisions 305198 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r305198 | qwell | 2011-01-31 15:30:44 -0600 (Mon, 31 Jan 2011) | 2 lines
  
  Fix compile error.  pseudofd no longer exists.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-31 21:31:31 +00:00
Jason Parker 5edeada22a Merged revisions 305131 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r305131 | qwell | 2011-01-31 15:00:25 -0600 (Mon, 31 Jan 2011) | 16 lines
  
  Merged revisions 305130 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r305130 | qwell | 2011-01-31 14:59:37 -0600 (Mon, 31 Jan 2011) | 9 lines
    
    Merged revisions 305129 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r305129 | qwell | 2011-01-31 14:56:25 -0600 (Mon, 31 Jan 2011) | 2 lines
      
      Set file descriptors to -1 on creation, so that we don't see weirdness later.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-31 21:01:28 +00:00
Tilghman Lesher 41260a6f20 Merged revisions 292376 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292376 | tilghman | 2010-10-19 19:40:29 -0500 (Tue, 19 Oct 2010) | 5 lines
  
  Oops.  This module uses the generic timer and no longer uses DAHDI.
  
  This causes a problem with the Solaris and other system builds that have gcc
  4.1 (where optional_api is non-optional).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-20 00:41:49 +00:00
Tzafrir Cohen 4d6eac5282 Merged revisions 292050 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r292050 | tzafrir | 2010-10-16 12:47:00 +0200 (ש', 16 אוק 2010) | 22 lines
  
  Merged revisions 292049 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r292049 | tzafrir | 2010-10-16 12:03:04 +0200 (ש', 16 אוק 2010) | 15 lines
    
    Base directory for MOH should be ASTDATADIR
    
    If the directive 'directory' is relative, make it relative to the
    datadir, rather than to the varlibdir. In the sample configuration
    it is relative ('moh').
    
    This has no effect unless you have actively set the datadir explicitly
    (at build time or at run time).
    
    (closes issue #16906)
    Patches:
          moh_datadir uploaded by tzafrir (license 46)
    
    Review: https://reviewboard.asterisk.org/r/974/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-16 11:51:54 +00:00
Brett Bryant 49d3bdd14c Merged revisions 285640 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285640 | bbryant | 2010-09-09 13:23:28 -0400 (Thu, 09 Sep 2010) | 21 lines
  
  Merged revisions 285639 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r285639 | bbryant | 2010-09-09 13:22:25 -0400 (Thu, 09 Sep 2010) | 14 lines
    
    Merged revisions 285638 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r285638 | bbryant | 2010-09-09 13:20:17 -0400 (Thu, 09 Sep 2010) | 7 lines
      
      Fixes an issue with MOH where it doesn't recover cleanly when it can't play a file and would just stop, instead of continuing to find the next playable file in the MOH class.
      
      (closes issue #17807)
      Reported by: kshumard
      
      Review: https://reviewboard.asterisk.org/r/910/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-09 17:25:24 +00:00
Jason Parker ef247c398f Merged revisions 285530 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285530 | qwell | 2010-09-08 15:43:10 -0500 (Wed, 08 Sep 2010) | 9 lines
  
  Merged revisions 285529 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r285529 | qwell | 2010-09-08 15:42:44 -0500 (Wed, 08 Sep 2010) | 1 line
    
    Follow coding guidelines in moh rescan fix.  Also fix the documentation that got me in trouble.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-08 20:43:38 +00:00
Jason Parker d077b0f081 Merged revisions 285527 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285527 | qwell | 2010-09-08 15:32:13 -0500 (Wed, 08 Sep 2010) | 15 lines
  
  Merged revisions 285526 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r285526 | qwell | 2010-09-08 15:31:43 -0500 (Wed, 08 Sep 2010) | 8 lines
    
    Fixes issue where moh files were no longer rescanned during a reload.
    
    (closes issue #16744)
    Reported by: pj
    Patches: 
          16744-reload.diff uploaded by qwell (license 4)
    Tested by: qwell
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-08 20:32:49 +00:00
Tilghman Lesher 3170dab50d Merged revisions 283770 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r283770 | tilghman | 2010-08-26 18:47:02 -0500 (Thu, 26 Aug 2010) | 8 lines
  
  Convert MOH to use generic timers.
  
  (closes issue #17726)
   Reported by: lmadsen
   Patches: 
         20100825__issue17726__2.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-26 23:51:55 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Tilghman Lesher f12afaaebc Add documentation for MOH realtime fields
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 20:25:11 +00:00
Tilghman Lesher 621a86db18 If there is realtime configuration, it does not get re-read on reload unless the config file also changes.
(closes issue #16982)
 Reported by: dmitri
 Patches: 
       res_musiconhold.patch uploaded by dmitri (license 1001)
 Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-23 21:53:49 +00:00
Paul Belanger 41d7b51bf7 Merged revisions 270331 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r270331 | pabelanger | 2010-06-14 17:31:59 -0400 (Mon, 14 Jun 2010) | 14 lines
  
  Properly play first file in sort list.
  
  When using sort=alpha we would always skip the first file
  in the list first time through.  We now check for that
  properly. 
  
  (closes issue #17470)
  Reported by: pabelanger
  Patches:
        sort.aplha.patch uploaded by pabelanger (license 224)
  Tested by: lmadsen
  
  Review: https://reviewboard.asterisk.org/r/703/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-14 21:33:55 +00:00
David Vossel e98835e437 fixes crash in moh when cachertclasses flag is used
The result for moh_register was not verified to guarantee
the mohclass as added to the container.


(closes issue #16993)
Reported by: dmitri
Patches:
      res_musiconhold_rtclass2.patch uploaded by dmitri (license 1001)
      moh_crash2.diff uploaded by dvossel (license 671)
Tested by: dmitri




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-09 15:09:25 +00:00
Mark Michelson 529a87ce7d Remove unrelated MOH change from previous commit.
Thanks Kevin!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-26 20:15:47 +00:00
Mark Michelson 8999372c33 Fix misspelling of macro args.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-26 20:04:51 +00:00
Mark Michelson a554e00fed Merged revisions 260345 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r260345 | mmichelson | 2010-04-30 15:08:15 -0500 (Fri, 30 Apr 2010) | 18 lines
  
  Fix potential crash from race condition due to accessing channel data without the channel locked.
  
  In res_musiconhold.c, there are several places where a channel's
  stream's existence is checked prior to calling ast_closestream on it. The issue
  here is that in several cases, the channel was not locked while checking the
  stream. The result was that if two threads checked the state of the channel's
  stream at approximately the same time, then there could be a situation where
  both threads attempt to call ast_closestream on the channel's stream. The result
  here is that the refcount for the stream would go below 0, resulting in a crash.
  
  I have added proper channel locking to res_musiconhold.c to ensure that
  we do not try to check chan->stream without the channel locked. A Digium customer
  has been using this patch for several weeks and has not had any crashes since
  applying the patch.
  
  ABE-2147
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-30 20:11:02 +00:00
Jeff Peeler 7f29269d68 Merged revisions 250786 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r250786 | jpeeler | 2010-03-04 19:02:58 -0600 (Thu, 04 Mar 2010) | 9 lines
  
  Fix not being able to specify a URL in MOH class directory.
  
  Don't attempt to chdir on a URL!
  
  (closes issue #16875)
  Reported by: raarts
  Patches: 
        moh-http.patch uploaded by raarts (license 937)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 01:05:46 +00:00
Sean Bright 1a30c33d47 Get MoH building on OpenSolaris.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-16 00:54:08 +00:00
Tilghman Lesher 055cb0e0ae Add the class actually used in the MusicOnHold start event.
(closes issue #16499)
 Reported by: syspert
 Patches: 
       mohclass.patch uploaded by syspert (license 938)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 22:54:59 +00:00
Tilghman Lesher b510b53ebc Missed a case that emits a WARNING where none is warranted.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-10 18:56:23 +00:00
Tilghman Lesher 219f969dcf Find another ref leak and change how we manage module references.
(closes issue #16388, closes issue #16279, closes issue #16390)
 Reported by: parisioa
 Patches: 
       20091208__issue16388.diff.txt uploaded by tilghman (license 14)
 Tested by: parisioa, tilghman
 Review: https://reviewboard.asterisk.org/r/442/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-08 18:22:44 +00:00
Tilghman Lesher c8d5ce7c13 Remove debugging line
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-03 00:09:36 +00:00
Tilghman Lesher 7e0a2db236 Fix multiple issues with musiconhold, which led to classes not getting destroyed properly.
* Classes are now tracked past removal from the core container, and module
   removal is actively prevented until all references are freed.
 * A hanging reference stored in the channel has been removed.  This could have
   caused a mismatch and the music state not properly cleared, if two or more
   reloads occurred between MOH being stopped and MOH being restarted.
 * In certain circumstances, duplicate classes were possible.
 * A race existed at reload time between a process being killed and the thread
   responsible for reading from the related pipe respawning that process.
 * Several reference counts have also been corrected.  At least one could have
   caused deleted classes to stick around forever, consuming resources.  This
   originally manifested as MOH external processes that were not killed at
   reload time.
(closes issue #16279, closes issue #16207)
 Reported by: parisioa, dcabot
 Patches: 
       20091202__issue16279__2.diff.txt uploaded by tilghman (license 14)
 Tested by: parisioa, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-03 00:08:55 +00:00
Tilghman Lesher 5e2aa190fe Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 20:42:03 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Kevin P. Fleming 1c9fe00920 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: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 01:24:24 +00:00
Matthias Nick 8e1bae06bf Sets the correct musicclass after an announcement
(closes issue #15279)
Reported by: mbeckwell
Patches:
      patch.txt uploaded by mnick (license )
Tested by: mnick

(closes issue #15832)
Reported by: mbeckwell
Patches:
      patch.txt uploaded by mnick (license 874)
Tested by: mnick




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-10 19:39:41 +00:00
Tilghman Lesher fdd078af52 Remove unnecessary define for Solaris
(closes issue #15358)
 Reported by: snuffy
 Patches: 
       bug_res_moh_remove_unneeded_include.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-28 16:50:05 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Mark Michelson 33a48e257e Honor channel's music class when using realtime music on hold.
(closes issue #15051)
Reported by: alexh
Patches:
      15051.patch uploaded by mmichelson (license 60)
Tested by: alexh



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 20:11:42 +00:00
Russell Bryant 730e60e583 Merged revisions 201600 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r201600 | russell | 2009-06-18 10:24:31 -0500 (Thu, 18 Jun 2009) | 29 lines
  
  Fix memory corruption and leakage related reloads of non files mode MoH classes.
  
  For Music on Hold classes that are not files mode, meaning that we are executing
  an application that will feed us audio data, we use a thread to monitor the
  external application and read audio from it.  This thread also makes use of the
  MoH class object.  In the MoH class destructor, we used pthread_cancel() to ask
  the thread to exit.  Unfortunately, the code did not wait to ensure that the
  thread actually went away.  What needed to be done is a pthread_join() to ensure
  that the thread fully cleans up before we proceed.  By adding this one line, we
  resolve two significant problems:
  
    1) Since the thread was never joined, it never fully goes away.  So, on every
       reload of non-files mode MoH, an unused thread was sticking around.
  
    2) There was a race condition here where the application monitoring thread
       could still try to access the MoH class, even though the thread executing
       the MoH reload has already destroyed it.
  
  (issue #15109)
  Reported by: jvandal
  
  (issue #15123)
  Reported by: axisinternet
  
  (issue #15195)
  Reported by: amorsen
  
  (issue AST-208)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18 15:27:10 +00:00
Eliel C. Sardanons 515166ba37 Move music on hold related applications documentation to XML.
Move MusicOnHold, SetMusicOnHold, StartMusicOnHold, StopMusicOnHold static
documentation to the new AstXML form.

(issue #15245)
Reported by: eliel
Patches:
      res_musiconhold_static_conversion.txt uploaded by lmadsen (license 10)
      (with some fixes and formatting by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-06 23:03:15 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Mark Michelson 0102e6cc44 Fix another crash related to cached realtime music on hold.
This was another off-by-one problem caused by moh_register.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-13 19:31:48 +00:00
Mark Michelson 5b5bd544ba Use safe macro practices even though they really aren't necessary.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 17:34:39 +00:00
Mark Michelson 0058b02563 Fix a crash in res_musiconhold when using cached realtime moh.
The moh_register function links an mohclass and then immediately
unrefs the class since the container now has a reference. The problem
with using realtime music on hold is that the class is allocated,
registered, and started in one fell swoop. The refcounting logic 
resulted in the count being off by one. The same problem did not
happen when using a static config because the allocation and registration
of an mohclass is a separate operation from starting moh. This also did
not affect non-cached realtime moh because the classes are not registered
at all.

I also have modified res_musiconhold to use the _t_ variants of the ao2_
functions so that more info can be gleaned when attempting to trace the
refcounts. I found this to be incredibly helpful for debugging this issue
and there's no good reason to remove it.

(closes issue #14661)
Reported by: sum



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 17:30:39 +00:00
Mark Michelson da786078f3 Merged revisions 187045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187045 | mmichelson | 2009-04-08 11:52:03 -0500 (Wed, 08 Apr 2009) | 10 lines
  
  Fix a small logical error when loading moh classes.
  
  We were unconditionally incrementing the number of mohclasses
  registered. However, we should actually only increment if the
  call to moh_register was successful.
  
  While this probably has never caused problems, I noticed it
  and decided to fix it anyway.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 16:52:20 +00:00
Joshua Colp 815c56369f Merged revisions 181664 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181664 | file | 2009-03-12 13:56:20 -0300 (Thu, 12 Mar 2009) | 2 lines
  
  Fix incorrect usage of strncasecmp... I really meant to use strcasecmp.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:56:58 +00:00
Joshua Colp e12265e530 Merged revisions 181659-181660 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181659 | file | 2009-03-12 13:50:37 -0300 (Thu, 12 Mar 2009) | 8 lines
  
  Fix another scenario where depending on configuration the stream would not get read.
  
  For custom commands we don't know whether the audio is coming from a stream or not
  so we are going to have to read the data despite no channels.
  
  (closes issue #14416)
  Reported by: caspy
........
  r181660 | file | 2009-03-12 13:52:45 -0300 (Thu, 12 Mar 2009) | 2 lines
  
  Fix logic flaw in previous commit.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:53:52 +00:00
Joshua Colp a80c5e37af Merged revisions 181655 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181655 | file | 2009-03-12 13:29:19 -0300 (Thu, 12 Mar 2009) | 10 lines
  
  Fix issue with streaming MOH failing if nobody is listening.
  
  When a music class is setup to actually provide music on hold
  from a stream we need to constantly read audio from it since it
  will constantly be providing audio. This is now done despite there
  being no channels listening to it.
  
  (closes issue #14416)
  Reported by: caspy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:32:20 +00:00
Joshua Colp 23760c47d3 Merged revisions 174218 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r174218 | file | 2009-02-09 10:48:21 -0400 (Mon, 09 Feb 2009) | 4 lines
  
  Don't overwrite our pointer to the music class when music on hold stops. We will use this if it starts again to see if we can resume the music where it left off.
  (closes issue #14407)
  Reported by: mostyn
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-09 14:49:24 +00:00
Russell Bryant 458a1025ad Merged revisions 168198 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r168198 | russell | 2009-01-09 16:14:38 -0600 (Fri, 09 Jan 2009) | 2 lines

Make this compile for mvanbaak

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 22:21:05 +00:00
Russell Bryant dd7ed66142 Cosmetic change - don't mix struct initializer styles.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 21:45:28 +00:00
Russell Bryant cf25187ac4 Fix a bad typo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 20:26:48 +00:00
Russell Bryant 77b1fe0ceb Re-work ref count handling of MoH classes using astobj2 to resolve crashes.
(closes issue #13566)
Reported by: igorcarneiro
Tested by: russell
Review: http://reviewboard.digium.com/r/106/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 16:10:40 +00:00
Russell Bryant 8cc50d4677 Merged revisions 165661 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165661 | russell | 2008-12-18 12:52:18 -0600 (Thu, 18 Dec 2008) | 7 lines

Set the process group ID on the MOH process so that all children will get killed

(closes issue #14099)
Reported by: caspy
Patches:
      res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 18:54:47 +00:00
Russell Bryant 1f40479382 Merged revisions 164605 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164605 | russell | 2008-12-16 08:28:10 -0600 (Tue, 16 Dec 2008) | 5 lines

Don't try to change working directory if a directory was not configured.

(closes issue #14089)
Reported by: caspy

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 14:31:02 +00:00
Jeff Peeler f0883cacca Merged revisions 162926 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162926 | jpeeler | 2008-12-10 16:52:51 -0600 (Wed, 10 Dec 2008) | 3 lines

Oops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 22:53:34 +00:00
Jeff Peeler 040e552c26 Merged revisions 162874 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162874 | jpeeler | 2008-12-10 16:04:18 -0600 (Wed, 10 Dec 2008) | 5 lines

(closes issue #13229)
Reported by: clegall_proformatique

Ensure that moh_generate does not return prematurely before local_ast_moh_stop is called. Also, the sleep in mp3_spawn now only occurs for http locations since it seems to have been added originally only for failing media streams.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 22:11:46 +00:00
Eliel C. Sardanons 1e8e12efcf Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Mark Michelson a361f7897a This change prevents a crash from occurring if res_musiconhold.so
is unloaded and then Asterisk is stopped. The problem was that
we are not unregistering the ast_moh_destroy function at exit.

(closes issue #13761)
Reported by: eliel
Patches:
      res_musiconhold.c.patch uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 23:59:02 +00:00
Kevin P. Fleming 60ef8fdae8 fix small bug introduced while cleaning up compiler warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 19:09:41 +00:00
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
Kevin P. Fleming 109a17ae79 support relative paths in musiconhold.conf, which makes moh work by default when Asterisk was configured using --prefix and 'make samples' is run
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 08:30:32 +00:00
Tilghman Lesher 08af5bb312 Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating
when a file is invalid from when a file is missing.  This is most important when
we have two configuration files.  Consider the following example:

Old system:
sip.conf     users.conf     Old result               New result
========     ==========     ==========               ==========
Missing      Missing        SIP doesn't load         SIP doesn't load
Missing      OK             SIP doesn't load         SIP doesn't load
Missing      Invalid        SIP doesn't load         SIP doesn't load
OK           Missing        SIP loads                SIP loads
OK           OK             SIP loads                SIP loads
OK           Invalid        SIP loads incompletely   SIP doesn't load
Invalid      Missing        SIP doesn't load         SIP doesn't load
Invalid      OK             SIP doesn't load         SIP doesn't load
Invalid      Invalid        SIP doesn't load         SIP doesn't load

So in the case when users.conf doesn't load because there's a typo that
disrupts the syntax, we may only partially load users, instead of failing with
an error, which may cause some calls not to get processed.  Worse yet, the old
system would do this with no indication that anything was even wrong.

(closes issue #10690)
 Reported by: dtyoo
 Patches: 
       20080716__bug10690.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 23:30:03 +00:00
Sean Bright 357bf3e90b All of the res/ stuff (other than res_jabber) from the RSW branch.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10 00:47:56 +00:00
Tilghman Lesher 638a720eee Add AMI events for start/stop of MOH
(closes issue #12909)
 Reported by: chris-mac
 Patches: 
       res_musiconhold-event.patch uploaded by chris-mac (license 506)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 21:21:26 +00:00
Kevin P. Fleming b71f8ac66a fix compile failure found by buildbot (go, buildbot!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 12:09:24 +00:00
Kevin P. Fleming fd4a60c459 Merged revisions 125132 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r125132 | kpfleming | 2008-06-25 17:21:30 -0500 (Wed, 25 Jun 2008) | 10 lines

allow tonezone to live in a different place than DAHDI/Zaptel, since dahdi-tools and dahdi-linux are now separate packages and can be installed in different places

don't include tonezone.h in dahdi_compat.h, because only a couple of modules need it

get app_rpt building again after the DAHDI changes

(closes issue #12911)
Reported by: tzafrir


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-25 23:05:28 +00:00
Michiel van Baak 8e8359465b Older versions of GNU gcc do not allow 'NULL' as sentinel.
They want (char *)NULL as sentinel.
An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4

This commit introduces a contstant SENTINEL which is declared as:
#define SENTINEL ((char *)NULL)

All places I could test compile on my openbsd system are converted.
Update CODING-GUIDELINES to tell about this constant.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 20:48:33 +00:00
Jeff Peeler ef3b214728 Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 17:27:55 +00:00
Michiel van Baak f1e9371da8 - revert change to ast_queue_hangup and create ast_queue_hangup_with_cause
- make data member of the ast_frame struct a named union instead of a void

Recently the ast_queue_hangup function got a new parameter, the hangupcause
Feedback came in that this is no good and that instead a new function should be created.
This I did.

The hangupcause was stored in the seqno member of the ast_frame struct. This is not very
elegant, and since there's already a data member that one should be used.
Problem is, this member was a void *.
Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone
wants to store another type in there in the future.

This commit is so massive, because all ast_frame.data uses have to be
altered to ast_frame.data.data

Thanks russellb and kpfleming for the feedback.

(closes issue #12674)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 16:29:54 +00:00
Jason Parker d63b790247 Merged revisions 115418 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115418 | qwell | 2008-05-06 14:34:58 -0500 (Tue, 06 May 2008) | 7 lines

Switch to using ast_random() rather than just rand().
This does not fix the bug reported, but I believe it is correct.

(from issue #12446)
Patches:
      bug_12446.diff uploaded by snuffy (license 35)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:38:44 +00:00
Jason Parker 8e26876b3e Merged revisions 114594 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114594 | qwell | 2008-04-23 13:28:44 -0500 (Wed, 23 Apr 2008) | 8 lines

Fix reload/unload for res_musiconhold module.

(closes issue #11575)
Reported by: sunder
Patches:
      M11575_14_rev3.diff uploaded by junky (license 177)
      bug11575_trunk.diff.txt uploaded by jamesgolovich (license 176)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 18:33:28 +00:00
Tilghman Lesher 123ac5fd64 Standardized routines for forking processes (keeps all the specialized code in one place).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 22:57:54 +00:00
Russell Bryant 3c6cf5dcc5 Add some fixes that I made in regards to wideband codec handling to get
G.722 music on hold working for me.

(issue #12164, reported by milazzo and jsmith, patches by me)

res/res_musiconhold.c:
 - I moved a single line so that the sample queue update happened before
   ast_write().  The reason that this was a bug is that the G.722 frame
   originally says it has 320 samples in it (which is correct).  However,
   when the frame is written to a channel that uses RTP, main/rtp.c modifies
   the frame to cut the number of samples in half before it sends it on
   the wire.  This is to account for the stupid incorrect G.722 spec that
   makes it so we have to lie about the number of samples with RTP.  I should
   probably go and re-work the RTP code so it doesn't modify the frame so
   that a bug like this won't happen in the future.  However, this change to
   MOH is harmless.

main/channel.c:
 - I made two fixes in regards to generator timing.  Generators use samples
   for timing.  However, this code assumed 8 kHz samples.  In one case, it was
   a hard coded 160 samples, that is now written as the sample rate / 50.  The
   other place was dealing with timing a generator based on frames coming from
   the other direction.  However, that would have only worked if the sample
   rates for the formats in both directions were the same.  The code now takes
   into account that the sample rates may differ, and scales the generator
   samples accordingly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-20 17:41:22 +00:00
Joshua Colp db0c6576d2 Merged revisions 110035 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r110035 | file | 2008-03-19 16:11:33 -0300 (Wed, 19 Mar 2008) | 4 lines

Add sanity checking for position resuming. We *have* to make sure that the position does not exceed the total number of files present, and we have to make sure that the position's filename is the same as previous. These values can change if a music class is reloaded and give unpredictable behavior.
(closes issue #11663)
Reported by: junky

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 19:13:39 +00:00
Jason Parker 71e3883f9f Merged revisions 108682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r108682 | qwell | 2008-03-14 09:29:05 -0500 (Fri, 14 Mar 2008) | 4 lines

Fix a potential segfault if chan (or chan->music_state) is NULL.

Closes issue #12210, credit to edantie for pointing this out.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-14 14:32:55 +00:00
Mark Michelson 8c3cf89933 1. Deprecate SetMusicOnHold and WaitMusicOnHold.
2. Add a duration parameter to MusicOnHold

(closes issue #11904)
Reported by: dimas
Patches:
      v2-moh.patch uploaded by dimas (license 88)
	  Tested by: dimas



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-13 15:47:25 +00:00
Mark Michelson 27cebd1d5c Removing a pointless memset. The memory was just calloc'd, so the
memory is already zeroed out



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-11 21:46:16 +00:00
Joshua Colp 48da910225 Merged revisions 90101 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90101 | file | 2007-11-28 18:59:28 -0400 (Wed, 28 Nov 2007) | 6 lines

Fix a few memory leaks.
(closes issue #11405)
Reported by: eliel
Patches:
      load_realtime.patch uploaded by eliel (license 64)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 23:03:09 +00:00
Mark Michelson a42259c3ff Adding support for realtime music on hold. The following are the main points:
1. When moh is started, we search first in memory to find the class. If we do not
   find it in memory, we search realtime instead.

2. When moh is restarted (as in, it had been started on this particular channel, stopped,
   and now we're starting it again), if using the "files" mode, then realtime will always
   be rechecked. If you are using other modes, however, we will simply reattach to the external
   running process which was playing moh earlier in the call. This is a necessary compromise so that
   we don't end up with too many background processes.

3. musiconhold.conf has a general section now. It has one option: cachertclasses. If set to yes,
   then moh classes found in realtime will be added to the in-memory list. This has the advantage
   of not requiring database lookups each time moh is started, but it has the disadvantage of not
   truly being realtime.

I have tested this for functionality, and it passes. I also tested this under valgrind and there
are no memory problems reported under typical use.

Special thanks to Sergee for implementing this feature and enduring my complaints on the bugtracker!

(closes issue #11196, reported and patched by sergee)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 00:47:22 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00
Luigi Rizzo 0595b5e2aa include "logger.h" and errno.h from asterisk.h - usage shows that they
were included almost everywhere.
Remove some of the instances.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 18:52:04 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Kevin P. Fleming edc78d6023 improve linked-list macros in two ways:
- the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +00:00
Russell Bryant 4e871ae483 Merged revisions 89053 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89053 | russell | 2007-11-06 14:18:49 -0600 (Tue, 06 Nov 2007) | 3 lines

Fix init_classes() so that classes that actually do have files loaded aren't
treated as empty, and immediately destroyed ...

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 20:22:50 +00:00
Mark Michelson 5a4867543d "show application <foo>" changes for clarity.
(closes issue #11171, reported and patched by blitzrage)

Many thanks!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 19:04:45 +00:00
Russell Bryant 4c6c69bdcc Merged revisions 89037 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89037 | russell | 2007-11-06 12:20:07 -0600 (Tue, 06 Nov 2007) | 11 lines

If someone were to delete the files used by an existing MOH class, and then
issue a reload, further use of that class could result in a crash due to
dividing by zero.  This set of changes fixes up some places to prevent this
from happening.

(closes issue #10948)
Reported by: jcomellas
Patches:
      res_musiconhold_division_by_zero.patch uploaded by jcomellas (license 282)
	  Additional changes added by me.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 18:23:36 +00:00
Jason Parker 59c9ff7ef2 More changes to change return values from load_module functions.
(issue #11096)
Patches:
      codec_adpcm.c.patch uploaded by moy (license 222)
      codec_alaw.c.patch uploaded by moy (license 222)
      codec_a_mu.c.patch uploaded by moy (license 222)
      codec_g722.c.patch uploaded by moy (license 222)
      codec_g726.c.diff uploaded by moy (license 222)
      codec_gsm.c.patch uploaded by moy (license 222)
      codec_ilbc.c.patch uploaded by moy (license 222)
      codec_lpc10.c.patch uploaded by moy (license 222)
      codec_speex.c.patch uploaded by moy (license 222)
      codec_ulaw.c.patch uploaded by moy (license 222)
      codec_zap.c.patch uploaded by moy (license 222)
      format_g723.c.patch uploaded by moy (license 222)
      format_g726.c.patch uploaded by moy (license 222)
      format_g729.c.patch uploaded by moy (license 222)
      format_gsm.c.patch uploaded by moy (license 222)
      format_h263.c.patch uploaded by moy (license 222)
      format_h264.c.patch uploaded by moy (license 222)
      format_ilbc.c.patch uploaded by moy (license 222)
      format_jpeg.c.patch uploaded by moy (license 222)
      format_ogg_vorbis.c.patch uploaded by moy (license 222)
      format_pcm.c.patch uploaded by moy (license 222)
      format_sln.c.patch uploaded by moy (license 222)
      format_vox.c.patch uploaded by moy (license 222)
      format_wav.c.patch uploaded by moy (license 222)
      format_wav_gsm.c.patch uploaded by moy (license 222)
      res_adsi.c.patch uploaded by eliel (license 64)
      res_ael_share.c.patch uploaded by eliel (license 64)
      res_clioriginate.c.patch uploaded by eliel (license 64)
      res_convert.c.patch uploaded by eliel (license 64)
      res_indications.c.patch uploaded by eliel (license 64)
      res_musiconhold.c.patch uploaded by eliel (license 64)
      res_smdi.c.patch uploaded by eliel (license 64)
      res_speech.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 19:24:29 +00:00
Jason Parker ebe4050128 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 20:05:18 +00:00
Jason Parker b0f3e6097e Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 18:29:40 +00:00
Tilghman Lesher 7e23779b01 On reload, re-read the files in the specified moh directory (closes issue #10536)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 07:12:18 +00:00
Russell Bryant df30de142c Add a new option for files-based music on hold to ensure that the sort order
of the files is alphabetical.

(closes issue #10855)
Reported by: jamesgolovich
Patches: 
      asterisk-mohsortalpha.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 14:43:56 +00:00
Joshua Colp 147688278c Merged revisions 84160 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r84160 | file | 2007-10-01 10:57:42 -0300 (Mon, 01 Oct 2007) | 6 lines

Fix randomness. save_pos was being set to 0 initially instead of -1, causing it to jump to position 0 when moh started.
(closes issue #10859)
Reported by: jamesgolovich
Patches:
      asterisk-mohpos2.diff.txt uploaded by jamesgolovich (license 176)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 13:59:13 +00:00
Jason Parker c7a9ec1691 (issue #10724)
Reported by: eliel
Patches:
      res_features.c.patch uploaded by eliel (license 64)
      res_agi.c.patch uploaded by seanbright (license 71)
      res_musiconhold.c.patch uploaded by seanbright (license 71)
      pbx.c.patch uploaded by moy (license 222)
      logger.c.patch uploaded by moy (license 222)
      frame.c.patch uploaded by moy (license 222)
      manager.c.patch uploaded by moy (license 222)
      http.c.patch uploaded by moy (license 222)
      dnsmgr.c.patch uploaded by moy (license 222)
      res_realtime.c.patch uploaded by eliel (license 64)
      res_odbc.c.patch uploaded by seanbright (license 71)
      res_jabber.c.patch uploaded by eliel (license 64)
      chan_local.c.patch uploaded by eliel (license 64)
      chan_agent.c.patch uploaded by eliel (license 64)
      chan_alsa.c.patch uploaded by eliel (license 64)
      chan_features.c.patch uploaded by eliel (license 64)
      chan_sip.c.patch uploaded by eliel (license 64)
      RollUp.1.patch (includes all of the above patches) uploaded by seanbright (license 71)

Convert many CLI commands to the NEW_CLI format.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 22:43:45 +00:00
Russell Bryant e23538696e Merged revisions 81042 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81042 | russell | 2007-08-27 11:16:25 -0500 (Mon, 27 Aug 2007) | 11 lines

(closes issue #10419)
Reported by: mustardman
Patches:
      asterisk-mohposition.diff.txt uploaded by jamesgolovich (license 176)

This patch fixes a few problems with music on hold.
 * Fix issues with starting at the beginning of a file when it shouldn't.
 * Fix the inuse counter to be decremented even if the class had not been
   set to be deleted when not in use anymore
 * Don't arbitrarily limit the number of MOH files to 255

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 16:16:56 +00:00
Russell Bryant 74200abe10 Merged revisions 79778 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79778 | russell | 2007-08-16 17:24:25 -0500 (Thu, 16 Aug 2007) | 14 lines

This patch fixes a bug where reloading the module with "module reload" did not
delete classes from memory that were no longer in the config.  This patch fixes
that problem as well as another one.  Previously, if you reloaded MOH using the
"moh reload" CLI command, which behaved differently than "module reload ...",
MOH had to be stopped on every channel and started again immediately.  However,
there was no way to tell what class was being used, so they would all fall back
to the default class.

(closes issue #10139)
Reported by: blitzrage
Patches: 
      asterisk-10139-advanced.diff.txt uploaded by jamesgolovich (license 176)
Tested by: jamesgolovich

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 22:30:39 +00:00
Tilghman Lesher 56b9568164 Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:09:46 +00:00
Jason Parker f38a688605 Modify the names of functions/variables in res_musiconhold to be useful.
Closes issue #10464, patch by caio1982


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15 22:53:45 +00:00
Russell Bryant f8483a0d04 Do a massive conversion for using the ast_verb() macro
(closes issue #10277, patches by mvanbaak)

Basically, this changes ...

if (option_verbose > 2)
   ast_verbose(VERBOSE_PREFIX_3, "Something\n");

to ...

ast_verb(3, "Something\n");


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 15:49:18 +00:00
Steve Murphy 0e969271ae After some study, thought, comparing, etc. I've backed out the previous universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 23:24:27 +00:00
Steve Murphy 8a7732f067 via 10206, I have added an option (e) to Dial to allow the h exten to get run on peer. Had to upgrade ast_flag stuff to 64 bits to do this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 19:40:29 +00:00
Russell Bryant fcd3f8dbea Merged revisions 75067 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75067 | russell | 2007-07-13 15:10:40 -0500 (Fri, 13 Jul 2007) | 14 lines

Merged revisions 75059 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75059 | russell | 2007-07-13 15:07:21 -0500 (Fri, 13 Jul 2007) | 6 lines

Ensure that adding a user to the list of users of a specific music on hold
class is not done at the same time as any of the other operations on this list
to prevent list corruption.  Using the global moh_data lock for this is not
ideal, but it is what is used to protect these lists everywhere else in the
module, and I am only changing what is necessary to fix the bug.

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 20:14:23 +00:00
Joshua Colp 7bc762c319 Merged revisions 74815 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r74815 | file | 2007-07-12 12:53:55 -0300 (Thu, 12 Jul 2007) | 10 lines

Merged revisions 74814 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74814 | file | 2007-07-12 12:51:24 -0300 (Thu, 12 Jul 2007) | 2 lines

Only print out a warning for situations where it is actually helpful. (issue #10187 reported by denke)

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 15:55:49 +00:00